Plugins/VcsPlugins/vcsSubversion/subversion.py

changeset 3190
a9a94491c4fd
parent 3160
209a07d7e401
child 3287
c3d784c057b3
diff -r 9a21c547de5f -r a9a94491c4fd Plugins/VcsPlugins/vcsSubversion/subversion.py
--- a/Plugins/VcsPlugins/vcsSubversion/subversion.py	Fri Jan 10 19:30:21 2014 +0100
+++ b/Plugins/VcsPlugins/vcsSubversion/subversion.py	Sat Jan 11 11:55:33 2014 +0100
@@ -170,14 +170,14 @@
                 return True, errMsg
             else:
                 if finished:
-                    errMsg = self.trUtf8(
+                    errMsg = self.tr(
                         "The svn process finished with the exit code {0}")\
                         .format(process.exitCode())
                 else:
-                    errMsg = self.trUtf8(
+                    errMsg = self.tr(
                         "The svn process did not finish within 30s.")
         else:
-            errMsg = self.trUtf8("Could not start the svn executable.")
+            errMsg = self.tr("Could not start the svn executable.")
         
         return False, errMsg
         
@@ -207,8 +207,8 @@
         if not success:
             E5MessageBox.critical(
                 self.__ui,
-                self.trUtf8("Create project in repository"),
-                self.trUtf8(
+                self.tr("Create project in repository"),
+                self.tr(
                     """The project could not be created in the repository."""
                     """ Maybe the given repository doesn't exist or the"""
                     """ repository server is down."""))
@@ -231,8 +231,8 @@
             if not os.path.isfile(pfn):
                 E5MessageBox.critical(
                     self.__ui,
-                    self.trUtf8("New project"),
-                    self.trUtf8(
+                    self.tr("New project"),
+                    self.tr(
                         """The project could not be checked out of the"""
                         """ repository.<br />"""
                         """Restoring the original contents."""))
@@ -306,7 +306,7 @@
                 QProcess(), "svn", args, os.path.join(tmpDir, project))
         else:
             dia = SvnDialog(
-                self.trUtf8('Importing project into Subversion repository'))
+                self.tr('Importing project into Subversion repository'))
             res = dia.startProcess(args, os.path.join(tmpDir, project))
             if res:
                 dia.exec_()
@@ -344,8 +344,8 @@
                         not tag.startswith('branches'):
                     type, ok = QInputDialog.getItem(
                         None,
-                        self.trUtf8("Subversion Checkout"),
-                        self.trUtf8(
+                        self.tr("Subversion Checkout"),
+                        self.tr(
                             "The tag must be a normal tag (tags) or"
                             " a branch tag (branches)."
                             " Please select from the list."),
@@ -369,7 +369,7 @@
             return self.startSynchronizedProcess(QProcess(), 'svn', args)
         else:
             dia = SvnDialog(
-                self.trUtf8('Checking project out of Subversion repository'))
+                self.tr('Checking project out of Subversion repository'))
             res = dia.startProcess(args)
             if res:
                 dia.exec_()
@@ -400,8 +400,8 @@
                         not tag.startswith('branches'):
                     type, ok = QInputDialog.getItem(
                         None,
-                        self.trUtf8("Subversion Export"),
-                        self.trUtf8(
+                        self.tr("Subversion Export"),
+                        self.tr(
                             "The tag must be a normal tag (tags) or"
                             " a branch tag (branches)."
                             " Please select from the list."),
@@ -422,7 +422,7 @@
         args.append(projectDir)
         
         dia = SvnDialog(
-            self.trUtf8('Exporting project from Subversion repository'))
+            self.tr('Exporting project from Subversion repository'))
         res = dia.startProcess(args)
         if res:
             dia.exec_()
@@ -492,8 +492,8 @@
             if not ok:
                 res = E5MessageBox.yesNo(
                     self.__ui,
-                    self.trUtf8("Commit Changes"),
-                    self.trUtf8(
+                    self.tr("Commit Changes"),
+                    self.tr(
                         """The commit affects files, that have unsaved"""
                         """ changes. Shall the commit be continued?"""),
                     icon=E5MessageBox.Warning)
@@ -541,7 +541,7 @@
             self.startSynchronizedProcess(QProcess(), "svn", args, dname)
         else:
             dia = SvnDialog(
-                self.trUtf8('Commiting changes to Subversion repository'))
+                self.tr('Commiting changes to Subversion repository'))
             res = dia.startProcess(args, dname)
             if res:
                 dia.exec_()
@@ -578,7 +578,7 @@
             res = False
         else:
             dia = SvnDialog(
-                self.trUtf8('Synchronizing with the Subversion repository'))
+                self.tr('Synchronizing with the Subversion repository'))
             res = dia.startProcess(args, dname, True)
             if res:
                 dia.exec_()
@@ -674,8 +674,8 @@
             self.startSynchronizedProcess(QProcess(), "svn", args, wdir)
         else:
             dia = SvnDialog(
-                self.trUtf8('Adding files/directories to the Subversion'
-                            ' repository'))
+                self.tr('Adding files/directories to the Subversion'
+                        ' repository'))
             res = dia.startProcess(args, wdir)
             if res:
                 dia.exec_()
@@ -764,7 +764,7 @@
             args.append(path)
         
         dia = SvnDialog(
-            self.trUtf8('Adding directory trees to the Subversion repository'))
+            self.tr('Adding directory trees to the Subversion repository'))
         res = dia.startProcess(args, dname)
         if res:
             dia.exec_()
@@ -799,8 +799,8 @@
             res = self.startSynchronizedProcess(QProcess(), "svn", args)
         else:
             dia = SvnDialog(
-                self.trUtf8('Removing files/directories from the Subversion'
-                            ' repository'))
+                self.tr('Removing files/directories from the Subversion'
+                        ' repository'))
             res = dia.startProcess(args)
             if res:
                 dia.exec_()
@@ -858,7 +858,7 @@
             if noDialog:
                 res = self.startSynchronizedProcess(QProcess(), "svn", args)
             else:
-                dia = SvnDialog(self.trUtf8('Moving {0}')
+                dia = SvnDialog(self.tr('Moving {0}')
                                 .format(name))
                 res = dia.startProcess(args)
                 if res:
@@ -887,8 +887,8 @@
         isFile = os.path.isfile(name)
         noEntries, ok = QInputDialog.getInt(
             None,
-            self.trUtf8("Subversion Log"),
-            self.trUtf8("Select number of entries to show."),
+            self.tr("Subversion Log"),
+            self.tr("Select number of entries to show."),
             self.getPlugin().getPreferences("LogLimit"), 1, 999999, 1)
         if ok:
             from .SvnLogDialog import SvnLogDialog
@@ -953,8 +953,8 @@
         if reposURL is None:
             E5MessageBox.critical(
                 self.__ui,
-                self.trUtf8("Subversion Error"),
-                self.trUtf8(
+                self.tr("Subversion Error"),
+                self.tr(
                     """The URL of the project repository could not be"""
                     """ retrieved from the working copy. The tag operation"""
                     """ will be aborted"""))
@@ -980,8 +980,8 @@
             if not rx_base.exactMatch(reposURL):
                 E5MessageBox.critical(
                     self.__ui,
-                    self.trUtf8("Subversion Error"),
-                    self.trUtf8(
+                    self.tr("Subversion Error"),
+                    self.tr(
                         """The URL of the project repository has an"""
                         """ invalid format. The tag operation will"""
                         """ be aborted"""))
@@ -1013,7 +1013,7 @@
             args.append('Deleted tag <{0}>'.format(tag))
             args.append(url)
         
-        dia = SvnDialog(self.trUtf8('Tagging {0} in the Subversion repository')
+        dia = SvnDialog(self.tr('Tagging {0} in the Subversion repository')
                         .format(name))
         res = dia.startProcess(args)
         if res:
@@ -1044,19 +1044,19 @@
                 DeleteFilesConfirmationDialog
             dlg = DeleteFilesConfirmationDialog(
                 self.parent(),
-                self.trUtf8("Revert changes"),
-                self.trUtf8("Do you really want to revert all changes to"
-                            " these files or directories?"),
+                self.tr("Revert changes"),
+                self.tr("Do you really want to revert all changes to"
+                        " these files or directories?"),
                 names)
             yes = dlg.exec_() == QDialog.Accepted
         else:
             yes = E5MessageBox.yesNo(
                 None,
-                self.trUtf8("Revert changes"),
-                self.trUtf8("""Do you really want to revert all changes of"""
-                            """ the project?"""))
+                self.tr("Revert changes"),
+                self.tr("""Do you really want to revert all changes of"""
+                        """ the project?"""))
         if yes:
-            dia = SvnDialog(self.trUtf8('Reverting changes'))
+            dia = SvnDialog(self.tr('Reverting changes'))
             res = dia.startProcess(args)
             if res:
                 dia.exec_()
@@ -1075,8 +1075,8 @@
         if reposURL is None:
             E5MessageBox.critical(
                 self.__ui,
-                self.trUtf8("Subversion Error"),
-                self.trUtf8(
+                self.tr("Subversion Error"),
+                self.tr(
                     """The URL of the project repository could not be"""
                     """ retrieved from the working copy. The switch"""
                     """ operation will be aborted"""))
@@ -1102,8 +1102,8 @@
             if not rx_base.exactMatch(reposURL):
                 E5MessageBox.critical(
                     self.__ui,
-                    self.trUtf8("Subversion Error"),
-                    self.trUtf8(
+                    self.tr("Subversion Error"),
+                    self.tr(
                         """The URL of the project repository has an"""
                         """ invalid format. The switch operation will"""
                         """ be aborted"""))
@@ -1131,7 +1131,7 @@
         args.append(url)
         args.append(name)
         
-        dia = SvnDialog(self.trUtf8('Switching to {0}')
+        dia = SvnDialog(self.tr('Switching to {0}')
                         .format(tn))
         res = dia.startProcess(args, setLanguage=True)
         if res:
@@ -1196,7 +1196,7 @@
             args.append(self.__svnURL(urlrev2))
         args.append(fname)
         
-        dia = SvnDialog(self.trUtf8('Merging {0}').format(name))
+        dia = SvnDialog(self.tr('Merging {0}').format(name))
         res = dia.startProcess(args, dname)
         if res:
             dia.exec_()
@@ -1462,7 +1462,7 @@
         self.addArguments(args, self.options['global'])
         args.append(name)
         
-        dia = SvnDialog(self.trUtf8('Cleaning up {0}')
+        dia = SvnDialog(self.tr('Cleaning up {0}')
                         .format(name))
         res = dia.startProcess(args)
         if res:
@@ -1492,7 +1492,7 @@
             args = []
             self.addArguments(args, commandList)
             
-            dia = SvnDialog(self.trUtf8('Subversion command'))
+            dia = SvnDialog(self.tr('Subversion command'))
             res = dia.startProcess(args, wd)
             if res:
                 dia.exec_()
@@ -1662,7 +1662,7 @@
                 args.append('--recursive')
             args.append(name)
         
-        dia = SvnDialog(self.trUtf8('Resolving conficts'))
+        dia = SvnDialog(self.tr('Resolving conficts'))
         res = dia.startProcess(args)
         if res:
             dia.exec_()
@@ -1693,7 +1693,7 @@
             args.append(name)
             args.append(target)
             
-            dia = SvnDialog(self.trUtf8('Copying {0}')
+            dia = SvnDialog(self.tr('Copying {0}')
                             .format(name))
             res = dia.startProcess(args)
             if res:
@@ -1734,9 +1734,9 @@
             if not propName:
                 E5MessageBox.critical(
                     self.__ui,
-                    self.trUtf8("Subversion Set Property"),
-                    self.trUtf8("""You have to supply a property name."""
-                                """ Aborting."""))
+                    self.tr("Subversion Set Property"),
+                    self.tr("""You have to supply a property name."""
+                            """ Aborting."""))
                 return
             
             args = []
@@ -1755,7 +1755,7 @@
                 dname, fname = self.splitPath(name)
                 args.append(fname)
             
-            dia = SvnDialog(self.trUtf8('Subversion Set Property'))
+            dia = SvnDialog(self.tr('Subversion Set Property'))
             res = dia.startProcess(args, dname)
             if res:
                 dia.exec_()
@@ -1769,8 +1769,8 @@
         """
         propName, ok = QInputDialog.getText(
             None,
-            self.trUtf8("Subversion Delete Property"),
-            self.trUtf8("Enter property name"),
+            self.tr("Subversion Delete Property"),
+            self.tr("Enter property name"),
             QLineEdit.Normal)
         
         if not ok:
@@ -1779,9 +1779,9 @@
         if not propName:
             E5MessageBox.critical(
                 self.__ui,
-                self.trUtf8("Subversion Delete Property"),
-                self.trUtf8("""You have to supply a property name."""
-                            """ Aborting."""))
+                self.tr("Subversion Delete Property"),
+                self.tr("""You have to supply a property name."""
+                        """ Aborting."""))
             return
         
         args = []
@@ -1797,7 +1797,7 @@
             dname, fname = self.splitPath(name)
             args.append(fname)
         
-        dia = SvnDialog(self.trUtf8('Subversion Delete Property'))
+        dia = SvnDialog(self.tr('Subversion Delete Property'))
         res = dia.startProcess(args, dname)
         if res:
             dia.exec_()
@@ -1954,10 +1954,10 @@
                         process.readAllStandardError(),
                         Preferences.getSystem("IOEncoding"), 'replace')
             else:
-                error = self.trUtf8(
+                error = self.tr(
                     "The svn process did not finish within 30s.")
         else:
-            error = self.trUtf8(
+            error = self.tr(
                 'The process {0} could not be started. '
                 'Ensure, that it is in the search path.').format('svn')
         
@@ -1994,7 +1994,7 @@
         if error:
             E5MessageBox.critical(
                 self.__ui,
-                self.trUtf8("Subversion Side-by-Side Difference"),
+                self.tr("Subversion Side-by-Side Difference"),
                 error)
             return
         name1 = "{0} (rev. {1})".format(name, rev1 and rev1 or ".")
@@ -2004,7 +2004,7 @@
             if error:
                 E5MessageBox.critical(
                     self.__ui,
-                    self.trUtf8("Subversion Side-by-Side Difference"),
+                    self.tr("Subversion Side-by-Side Difference"),
                     error)
                 return
             name2 = "{0} (rev. {1})".format(name, rev2)
@@ -2017,8 +2017,8 @@
             except IOError:
                 E5MessageBox.critical(
                     self.__ui,
-                    self.trUtf8("Subversion Side-by-Side Difference"),
-                    self.trUtf8(
+                    self.tr("Subversion Side-by-Side Difference"),
+                    self.tr(
                         """<p>The file <b>{0}</b> could not be read.</p>""")
                     .format(name))
                 return
@@ -2065,7 +2065,7 @@
             args.append(fname)
         
         dia = SvnDialog(
-            self.trUtf8('Locking in the Subversion repository'), parent)
+            self.tr('Locking in the Subversion repository'), parent)
         res = dia.startProcess(args, dname)
         if res:
             dia.exec_()
@@ -2093,7 +2093,7 @@
             args.append(fname)
         
         dia = SvnDialog(
-            self.trUtf8('Unlocking in the Subversion repository'), parent)
+            self.tr('Unlocking in the Subversion repository'), parent)
         res = dia.startProcess(args, dname)
         if res:
             dia.exec_()
@@ -2117,7 +2117,7 @@
             args.append(newUrl)
             args.append(projectPath)
             
-            dia = SvnDialog(self.trUtf8('Relocating'))
+            dia = SvnDialog(self.tr('Relocating'))
             res = dia.startProcess(args)
             if res:
                 dia.exec_()
@@ -2136,8 +2136,8 @@
         if url is None:
             url, ok = QInputDialog.getText(
                 None,
-                self.trUtf8("Repository Browser"),
-                self.trUtf8("Enter the repository URL."),
+                self.tr("Repository Browser"),
+                self.tr("Enter the repository URL."),
                 QLineEdit.Normal)
             if not ok or not url:
                 return
@@ -2168,7 +2168,7 @@
             dname, fname = self.splitPath(names)
             args.append(fname)
         
-        dia = SvnDialog(self.trUtf8('Remove from changelist'))
+        dia = SvnDialog(self.tr('Remove from changelist'))
         res = dia.startProcess(args, dname)
         if res:
             dia.exec_()
@@ -2184,8 +2184,8 @@
         """
         clname, ok = QInputDialog.getItem(
             None,
-            self.trUtf8("Add to changelist"),
-            self.trUtf8("Enter name of the changelist:"),
+            self.tr("Add to changelist"),
+            self.tr("Enter name of the changelist:"),
             sorted(self.svnGetChangelists()),
             0, True)
         if not ok or not clname:
@@ -2203,7 +2203,7 @@
             dname, fname = self.splitPath(names)
             args.append(fname)
         
-        dia = SvnDialog(self.trUtf8('Remove from changelist'))
+        dia = SvnDialog(self.tr('Remove from changelist'))
         res = dia.startProcess(args, dname)
         if res:
             dia.exec_()
@@ -2268,7 +2268,7 @@
         args.append("upgrade")
         args.append(".")
         
-        dia = SvnDialog(self.trUtf8('Upgrade'))
+        dia = SvnDialog(self.tr('Upgrade'))
         res = dia.startProcess(args, path)
         if res:
             dia.exec_()

eric ide

mercurial