diff -r 10516539f238 -r 0a02c433f52d Plugins/VcsPlugins/vcsMercurial/hg.py --- a/Plugins/VcsPlugins/vcsMercurial/hg.py Fri Oct 18 23:00:41 2013 +0200 +++ b/Plugins/VcsPlugins/vcsMercurial/hg.py Fri Nov 01 15:48:48 2013 +0100 @@ -266,7 +266,8 @@ """ success = self.vcsImport(vcsDataDict, project.ppath)[0] if not success: - E5MessageBox.critical(self.__ui, + E5MessageBox.critical( + self.__ui, self.trUtf8("Create project repository"), self.trUtf8( """The project repository could not be created.""")) @@ -456,7 +457,8 @@ break if not ok: - res = E5MessageBox.yesNo(self.__ui, + res = E5MessageBox.yesNo( + self.__ui, self.trUtf8("Commit Changes"), self.trUtf8( """The commit affects files, that have unsaved""" @@ -961,7 +963,8 @@ if names[0]: from UI.DeleteFilesConfirmationDialog import \ DeleteFilesConfirmationDialog - dlg = DeleteFilesConfirmationDialog(self.parent(), + dlg = DeleteFilesConfirmationDialog( + self.parent(), self.trUtf8("Revert changes"), self.trUtf8( "Do you really want to revert all changes to these files" @@ -969,7 +972,8 @@ names) yes = dlg.exec_() == QDialog.Accepted else: - yes = E5MessageBox.yesNo(None, + yes = E5MessageBox.yesNo( + None, self.trUtf8("Revert changes"), self.trUtf8("""Do you really want to revert all changes of""" """ the project?""")) @@ -1178,8 +1182,8 @@ if procStarted: finished = process.waitForFinished(30000) if finished and process.exitCode() == 0: - output = \ - str(process.readAllStandardOutput(), + output = str( + process.readAllStandardOutput(), Preferences.getSystem("IOEncoding"), 'replace') else: @@ -1340,7 +1344,8 @@ if procStarted: finished = process.waitForFinished(30000) if finished and process.exitCode() == 0: - output = str(process.readAllStandardOutput(), + output = str( + process.readAllStandardOutput(), Preferences.getSystem("IOEncoding"), 'replace') else: output, error = self.__client.runcommand(args) @@ -1354,23 +1359,28 @@ line.split("@@@") cdate, ctime = date.split()[:2] info = [] - info.append(QApplication.translate("mercurial", + info.append(QApplication.translate( + "mercurial", """<tr><td><b>Parent #{0}</b></td><td></td></tr>\n""" """<tr><td><b>Changeset</b></td><td>{1}</td></tr>""")\ .format(index, changeset)) if tags: - info.append(QApplication.translate("mercurial", + info.append(QApplication.translate( + "mercurial", """<tr><td><b>Tags</b></td><td>{0}</td></tr>""")\ .format('<br/>'.join(tags.split()))) if bookmarks: - info.append(QApplication.translate("mercurial", + info.append(QApplication.translate( + "mercurial", """<tr><td><b>Bookmarks</b></td><td>{0}</td></tr>""")\ .format('<br/>'.join(bookmarks.split()))) if branches: - info.append(QApplication.translate("mercurial", + info.append(QApplication.translate( + "mercurial", """<tr><td><b>Branches</b></td><td>{0}</td></tr>""")\ .format('<br/>'.join(branches.split()))) - info.append(QApplication.translate("mercurial", + info.append(QApplication.translate( + "mercurial", """<tr><td><b>Last author</b></td><td>{0}</td></tr>\n""" """<tr><td><b>Committed date</b></td><td>{1}</td></tr>\n""" """<tr><td><b>Committed time</b></td><td>{2}</td></tr>""")\ @@ -1394,7 +1404,8 @@ if procStarted: finished = process.waitForFinished(30000) if finished and process.exitCode() == 0: - output = str(process.readAllStandardOutput(), + output = str( + process.readAllStandardOutput(), Preferences.getSystem("IOEncoding"), 'replace') else: output, error = self.__client.runcommand(args) @@ -1404,7 +1415,8 @@ else: url = "" - return QApplication.translate('mercurial', + return QApplication.translate( + 'mercurial', """<h3>Repository information</h3>\n""" """<p><table>\n""" """<tr><td><b>Mercurial V.</b></td><td>{0}</td></tr>\n""" @@ -1491,8 +1503,8 @@ if os.path.splitdrive(repodir)[1] == os.sep: return False - dia = HgDialog(self.trUtf8('Copying {0}') - .format(name), self) + dia = HgDialog( + self.trUtf8('Copying {0}').format(name), self) res = dia.startProcess(args, repodir) if res: dia.exec_() @@ -1720,16 +1732,19 @@ finished = process.waitForFinished(30000) if finished: if process.exitCode() == 0: - output = str(process.readAllStandardOutput(), + output = str( + process.readAllStandardOutput(), Preferences.getSystem("IOEncoding"), 'replace') else: - error = str(process.readAllStandardError(), + error = str( + process.readAllStandardError(), Preferences.getSystem("IOEncoding"), 'replace') else: error = self.trUtf8( "The hg process did not finish within 30s.") else: - error = self.trUtf8('The process {0} could not be started. ' + error = self.trUtf8( + 'The process {0} could not be started. ' 'Ensure, that it is in the search path.').format('hg') else: output, error = self.__client.runcommand(args) @@ -1777,7 +1792,8 @@ output1, error = self.__hgGetFileForRevision(name, rev=rev1) if error: - E5MessageBox.critical(self.__ui, + E5MessageBox.critical( + self.__ui, self.trUtf8("Mercurial Side-by-Side Difference"), error) return @@ -1786,7 +1802,8 @@ if rev2: output2, error = self.__hgGetFileForRevision(name, rev=rev2) if error: - E5MessageBox.critical(self.__ui, + E5MessageBox.critical( + self.__ui, self.trUtf8("Mercurial Side-by-Side Difference"), error) return @@ -1798,7 +1815,8 @@ f1.close() name2 = name except IOError: - E5MessageBox.critical(self.__ui, + E5MessageBox.critical( + self.__ui, self.trUtf8("Mercurial Side-by-Side Difference"), self.trUtf8( """<p>The file <b>{0}</b> could not be read.</p>""") @@ -1972,7 +1990,8 @@ if procStarted: finished = process.waitForFinished(30000) if finished and process.exitCode() == 0: - output = str(process.readAllStandardOutput(), + output = str( + process.readAllStandardOutput(), Preferences.getSystem("IOEncoding"), 'replace') else: output, error = self.__client.runcommand(args) @@ -1986,36 +2005,45 @@ cdate, ctime = date.split()[:2] info.append("""<p><table>""") if mode == "heads": - info.append(QApplication.translate("mercurial", + info.append(QApplication.translate( + "mercurial", """<tr><td><b>Head #{0}</b></td><td></td></tr>\n""" .format(index, changeset))) elif mode == "parents": - info.append(QApplication.translate("mercurial", + info.append(QApplication.translate( + "mercurial", """<tr><td><b>Parent #{0}</b></td><td></td></tr>\n""" .format(index, changeset))) elif mode == "tip": - info.append(QApplication.translate("mercurial", + info.append(QApplication.translate( + "mercurial", """<tr><td><b>Tip</b></td><td></td></tr>\n""")) - info.append(QApplication.translate("mercurial", + info.append(QApplication.translate( + "mercurial", """<tr><td><b>Changeset</b></td><td>{0}</td></tr>""")\ .format(changeset)) if tags: - info.append(QApplication.translate("mercurial", + info.append(QApplication.translate( + "mercurial", """<tr><td><b>Tags</b></td><td>{0}</td></tr>""")\ .format('<br/>'.join(tags.split()))) if bookmarks: - info.append(QApplication.translate("mercurial", + info.append(QApplication.translate( + "mercurial", """<tr><td><b>Bookmarks</b></td><td>{0}</td></tr>""")\ .format('<br/>'.join(bookmarks.split()))) if branches: - info.append(QApplication.translate("mercurial", + info.append(QApplication.translate( + "mercurial", """<tr><td><b>Branches</b></td><td>{0}</td></tr>""")\ .format('<br/>'.join(branches.split()))) if parents: - info.append(QApplication.translate("mercurial", + info.append(QApplication.translate( + "mercurial", """<tr><td><b>Parents</b></td><td>{0}</td></tr>""")\ .format('<br/>'.join(parents.split()))) - info.append(QApplication.translate("mercurial", + info.append(QApplication.translate( + "mercurial", """<tr><td><b>Last author</b></td><td>{0}</td></tr>\n""" """<tr><td><b>Committed date</b></td><td>{1}</td></tr>\n""" """<tr><td><b>Committed time</b></td><td>{2}</td></tr>\n""" @@ -2311,7 +2339,8 @@ ignoreName = os.path.join(name, Hg.IgnoreFileName) if os.path.exists(ignoreName): - res = E5MessageBox.yesNo(self.__ui, + res = E5MessageBox.yesNo( + self.__ui, self.trUtf8("Create .hgignore file"), self.trUtf8("""<p>The file <b>{0}</b> exists already.""" """ Overwrite it?</p>""").format(ignoreName), @@ -2381,7 +2410,8 @@ if ex: fname += ex if QFileInfo(fname).exists(): - res = E5MessageBox.yesNo(self.__ui, + res = E5MessageBox.yesNo( + self.__ui, self.trUtf8("Create changegroup"), self.trUtf8("<p>The Mercurial changegroup file <b>{0}</b> " "already exists. Overwrite it?</p>") @@ -2506,7 +2536,8 @@ if files: self.__lastChangeGroupPath = os.path.dirname(files[0]) - update = E5MessageBox.yesNo(self.__ui, + update = E5MessageBox.yesNo( + self.__ui, self.trUtf8("Apply changegroups"), self.trUtf8("""Shall the working directory be updated?"""), yesDefault=True) @@ -2647,7 +2678,8 @@ if dlg.exec_() == QDialog.Accepted: rev, merge, date, user, message = dlg.getParameters() if not rev: - E5MessageBox.warning(self.__ui, + E5MessageBox.warning( + self.__ui, self.trUtf8("Backing out changeset"), self.trUtf8("""No revision given. Aborting...""")) return @@ -3029,7 +3061,8 @@ contents = f.readlines() f.close() except IOError as err: - E5MessageBox.critical(self.__ui, + E5MessageBox.critical( + self.__ui, self.trUtf8("Add Sub-repository"), self.trUtf8( """<p>The sub-repositories file .hgsub could not""" @@ -3038,7 +3071,8 @@ return if entry in contents: - E5MessageBox.critical(self.__ui, + E5MessageBox.critical( + self.__ui, self.trUtf8("Add Sub-repository"), self.trUtf8( """<p>The sub-repositories file .hgsub already""" @@ -3056,7 +3090,8 @@ f.writelines(contents) f.close() except IOError as err: - E5MessageBox.critical(self.__ui, + E5MessageBox.critical( + self.__ui, self.trUtf8("Add Sub-repository"), self.trUtf8( """<p>The sub-repositories file .hgsub could not""" @@ -3076,7 +3111,8 @@ subrepositories = [] if not os.path.isfile(hgsub): - E5MessageBox.critical(self.__ui, + E5MessageBox.critical( + self.__ui, self.trUtf8("Remove Sub-repositories"), self.trUtf8("""<p>The sub-repositories file .hgsub does not""" """ exist. Aborting...</p>""")) @@ -3087,7 +3123,8 @@ subrepositories = [line.strip() for line in f.readlines()] f.close() except IOError as err: - E5MessageBox.critical(self.__ui, + E5MessageBox.critical( + self.__ui, self.trUtf8("Remove Sub-repositories"), self.trUtf8("""<p>The sub-repositories file .hgsub could not""" """ be read.</p><p>Reason: {0}</p>""") @@ -3105,7 +3142,8 @@ f.write(contents) f.close() except IOError as err: - E5MessageBox.critical(self.__ui, + E5MessageBox.critical( + self.__ui, self.trUtf8("Remove Sub-repositories"), self.trUtf8( """<p>The sub-repositories file .hgsub could not""" @@ -3135,7 +3173,8 @@ if self.__client: ok, err = self.__client.restartServer() if not ok: - E5MessageBox.warning(None, + E5MessageBox.warning( + None, self.trUtf8("Mercurial Command Server"), self.trUtf8( """<p>The Mercurial Command Server could not be""" @@ -3181,7 +3220,8 @@ if procStarted: finished = process.waitForFinished(30000) if finished and process.exitCode() == 0: - output = str(process.readAllStandardOutput(), + output = str( + process.readAllStandardOutput(), Preferences.getSystem("IOEncoding"), 'replace') else: output, error = self.__client.runcommand(args) @@ -3271,7 +3311,8 @@ if ok: self.__client = client else: - E5MessageBox.warning(None, + E5MessageBox.warning( + None, self.trUtf8("Mercurial Command Server"), self.trUtf8( """<p>The Mercurial Command Server could not be"""