Plugins/VcsPlugins/vcsPySvn/subversion.py

changeset 3190
a9a94491c4fd
parent 3160
209a07d7e401
child 3287
c3d784c057b3
diff -r 9a21c547de5f -r a9a94491c4fd Plugins/VcsPlugins/vcsPySvn/subversion.py
--- a/Plugins/VcsPlugins/vcsPySvn/subversion.py	Fri Jan 10 19:30:21 2014 +0100
+++ b/Plugins/VcsPlugins/vcsPySvn/subversion.py	Sat Jan 11 11:55:33 2014 +0100
@@ -199,8 +199,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."""))
@@ -223,8 +223,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."""))
@@ -295,7 +295,7 @@
         client = self.getClient()
         if not noDialog:
             dlg = SvnDialog(
-                self.trUtf8('Importing project into Subversion repository'),
+                self.tr('Importing project into Subversion repository'),
                 "import{0} --message {1} .".format(
                     (not recurse) and " --non-recursive" or "", msg),
                 client)
@@ -310,7 +310,7 @@
                 dlg.showError(e.args[0])
         locker.unlock()
         if not noDialog:
-            rev and dlg.showMessage(self.trUtf8("Imported revision {0}.\n")
+            rev and dlg.showMessage(self.tr("Imported revision {0}.\n")
                                     .format(rev.number))
             dlg.finish()
             dlg.exec_()
@@ -348,8 +348,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."),
@@ -368,7 +368,7 @@
         client = self.getClient()
         if not noDialog:
             dlg = SvnDialog(
-                self.trUtf8('Checking project out of Subversion repository'),
+                self.tr('Checking project out of Subversion repository'),
                 "checkout{0} {1} {2}".format(
                     (not recurse) and " --non-recursive" or "",
                     url, projectDir),
@@ -413,8 +413,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."),
@@ -432,7 +432,7 @@
         url = self.__svnURL(svnUrl)
         client = self.getClient()
         dlg = SvnDialog(
-            self.trUtf8('Exporting project from Subversion repository'),
+            self.tr('Exporting project from Subversion repository'),
             "export --force{0} {1} {2}".format(
                 (not recurse) and " --non-recursive" or "",
                 url, projectDir),
@@ -513,8 +513,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)
@@ -555,7 +555,7 @@
         client = self.getClient()
         if not noDialog:
             dlg = SvnDialog(
-                self.trUtf8('Commiting changes to Subversion repository'),
+                self.tr('Commiting changes to Subversion repository'),
                 "commit{0}{1}{2}{3} --message {4} {5}".format(
                     (not recurse) and " --non-recursive" or "",
                     keeplocks and " --keep-locks" or "",
@@ -580,7 +580,7 @@
                 dlg.showError(e.args[0])
         locker.unlock()
         if not noDialog:
-            rev and dlg.showMessage(self.trUtf8("Committed revision {0}.")
+            rev and dlg.showMessage(self.tr("Committed revision {0}.")
                                     .format(rev.number))
             dlg.finish()
             dlg.exec_()
@@ -613,7 +613,7 @@
         client = self.getClient()
         if not noDialog:
             dlg = SvnDialog(
-                self.trUtf8('Synchronizing with the Subversion repository'),
+                self.tr('Synchronizing with the Subversion repository'),
                 "update{0} {1}".format(
                     (not recurse) and " --non-recursive" or "",
                     " ".join(fnames)),
@@ -721,8 +721,8 @@
         client = self.getClient()
         if not noDialog:
             dlg = SvnDialog(
-                self.trUtf8('Adding files/directories to the Subversion'
-                            ' repository'),
+                self.tr('Adding files/directories to the Subversion'
+                        ' repository'),
                 "add --non-recursive{0}{1} {2}".format(
                     force and " --force" or "",
                     noignore and " --no-ignore" or "",
@@ -829,7 +829,7 @@
         ignore = "--ignore" in opts
         client = self.getClient()
         dlg = SvnDialog(
-            self.trUtf8('Adding directory trees to the Subversion repository'),
+            self.tr('Adding directory trees to the Subversion repository'),
             "add{0}{1} {2}".format(
                 force and " --force" or "",
                 ignore and " --ignore" or "",
@@ -866,8 +866,8 @@
         client = self.getClient()
         if not noDialog:
             dlg = SvnDialog(
-                self.trUtf8('Removing files/directories from the Subversion'
-                            ' repository'),
+                self.tr('Removing files/directories from the Subversion'
+                        ' repository'),
                 "remove{0} {1}".format(
                     force and " --force" or "",
                     " ".join(name)),
@@ -930,7 +930,7 @@
             if not noDialog:
                 dlg = \
                     SvnDialog(
-                        self.trUtf8('Moving {0}').format(name),
+                        self.tr('Moving {0}').format(name),
                         "move{0}{1} {2} {3}".format(
                             force and " --force" or "",
                             log and (" --message {0}".format(log)) or "",
@@ -972,8 +972,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
@@ -1040,8 +1040,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"""))
@@ -1067,8 +1067,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"""))
@@ -1089,7 +1089,7 @@
         if tagOp in [1, 2]:
             log = 'Created tag <{0}>'.format(self.tagName)
             dlg = SvnDialog(
-                self.trUtf8('Tagging {0} in the Subversion repository')
+                self.tr('Tagging {0} in the Subversion repository')
                     .format(name),
                 "copy --message {0} {1} {2}".format(log, reposURL, url),
                 client, log=log)
@@ -1103,7 +1103,7 @@
         else:
             log = 'Deleted tag <{0}>'.format(self.tagName)
             dlg = SvnDialog(
-                self.trUtf8('Tagging {0} in the Subversion repository')
+                self.tr('Tagging {0} in the Subversion repository')
                     .format(name),
                 "remove --message {0} {1}".format(log, url),
                 client, log=log)
@@ -1115,7 +1115,7 @@
                 dlg.showError(e.args[0])
             locker.unlock()
         rev and dlg.showMessage(
-            self.trUtf8("Revision {0}.\n").format(rev.number))
+            self.tr("Revision {0}.\n").format(rev.number))
         dlg.finish()
         dlg.exec_()
         
@@ -1138,8 +1138,8 @@
                 DeleteFilesConfirmationDialog
             dia = DeleteFilesConfirmationDialog(
                 self.parent(),
-                self.trUtf8("Revert changes"),
-                self.trUtf8(
+                self.tr("Revert changes"),
+                self.tr(
                     "Do you really want to revert all changes to these files"
                     " or directories?"),
                 name)
@@ -1147,13 +1147,13 @@
         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:
             client = self.getClient()
             dlg = SvnDialog(
-                self.trUtf8('Reverting changes'),
+                self.tr('Reverting changes'),
                 "revert {0} {1}".format(
                     (not recurse) and " --non-recursive" or "",
                     " ".join(name)),
@@ -1183,8 +1183,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"""))
@@ -1210,8 +1210,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"""))
@@ -1232,14 +1232,14 @@
             tn = url
         
         client = self.getClient()
-        dlg = SvnDialog(self.trUtf8('Switching to {0}').format(tn),
+        dlg = SvnDialog(self.tr('Switching to {0}').format(tn),
                         "switch {0} {1}".format(url, name),
                         client)
         QApplication.processEvents()
         locker = QMutexLocker(self.vcsExecutionMutex)
         try:
             rev = client.switch(name, url)
-            dlg.showMessage(self.trUtf8("Revision {0}.\n").format(rev.number))
+            dlg.showMessage(self.tr("Revision {0}.\n").format(rev.number))
         except pysvn.ClientError as e:
             dlg.showError(e.args[0])
         locker.unlock()
@@ -1336,7 +1336,7 @@
         client = self.getClient()
         dlg = \
             SvnDialog(
-                self.trUtf8('Merging {0}').format(name),
+                self.tr('Merging {0}').format(name),
                 "merge{0}{1} {2} {3} {4}".format(
                     (not recurse) and " --non-recursive" or "",
                     force and " --force" or "",
@@ -1634,7 +1634,7 @@
         @param name directory name to be cleaned up (string)
         """
         client = self.getClient()
-        dlg = SvnDialog(self.trUtf8('Cleaning up {0}').format(name),
+        dlg = SvnDialog(self.tr('Cleaning up {0}').format(name),
                         "cleanup {0}".format(name),
                         client)
         QApplication.processEvents()
@@ -1673,7 +1673,7 @@
             
             from Plugins.VcsPlugins.vcsSubversion.SvnDialog import \
                 SvnDialog as SvnProcessDialog
-            dia = SvnProcessDialog(self.trUtf8('Subversion command'))
+            dia = SvnProcessDialog(self.tr('Subversion command'))
             res = dia.startProcess(args, wd)
             if res:
                 dia.exec_()
@@ -1790,7 +1790,7 @@
         opts = self.options['global']
         recurse = "--non-recursive" not in opts
         client = self.getClient()
-        dlg = SvnDialog(self.trUtf8('Resolving conficts'),
+        dlg = SvnDialog(self.tr('Resolving conficts'),
                         "resolved{0} {1}".format(
                             (not recurse) and " --non-recursive" or "",
                             " ".join(fnames)),
@@ -1831,7 +1831,7 @@
                 target = target
             dlg = \
                 SvnDialog(
-                    self.trUtf8('Copying {0}').format(name),
+                    self.tr('Copying {0}').format(name),
                     "copy{0} {1} {2}".format(
                         log and (" --message {0}".format(log)) or "",
                         name, target),
@@ -1883,8 +1883,8 @@
             if not propName:
                 E5MessageBox.critical(
                     self.__ui,
-                    self.trUtf8("Subversion Set Property"),
-                    self.trUtf8(
+                    self.tr("Subversion Set Property"),
+                    self.tr(
                         """You have to supply a property name. Aborting."""))
                 return
             
@@ -1902,7 +1902,7 @@
             client = self.getClient()
             dlg = \
                 SvnDialog(
-                    self.trUtf8('Subversion Set Property'),
+                    self.tr('Subversion Set Property'),
                     "propset{0}{1} {2} {3} {4}".format(
                         recurse and " --recurse" or "",
                         skipchecks and " --skip-checks" or "",
@@ -1917,7 +1917,7 @@
             except pysvn.ClientError as e:
                 dlg.showError(e.args[0])
             locker.unlock()
-            dlg.showMessage(self.trUtf8("Property set."))
+            dlg.showMessage(self.tr("Property set."))
             dlg.finish()
             dlg.exec_()
             os.chdir(cwd)
@@ -1937,8 +1937,8 @@
             if not propName:
                 E5MessageBox.critical(
                     self.__ui,
-                    self.trUtf8("Subversion Delete Property"),
-                    self.trUtf8(
+                    self.tr("Subversion Delete Property"),
+                    self.tr(
                         """You have to supply a property name. Aborting."""))
                 return
             
@@ -1956,7 +1956,7 @@
             client = self.getClient()
             dlg = \
                 SvnDialog(
-                    self.trUtf8('Subversion Delete Property'),
+                    self.tr('Subversion Delete Property'),
                     "propdel{0}{1} {2} {3}".format(
                         recurse and " --recurse" or "",
                         skipchecks and " --skip-checks" or "",
@@ -1970,7 +1970,7 @@
             except pysvn.ClientError as e:
                 dlg.showError(e.args[0])
             locker.unlock()
-            dlg.showMessage(self.trUtf8("Property deleted."))
+            dlg.showMessage(self.tr("Property deleted."))
             dlg.finish()
             dlg.exec_()
             os.chdir(cwd)
@@ -2166,7 +2166,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 ".")
@@ -2176,7 +2176,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)
@@ -2189,8 +2189,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
@@ -2227,8 +2227,8 @@
         """
         comment, ok = QInputDialog.getText(
             None,
-            self.trUtf8("Subversion Lock"),
-            self.trUtf8("Enter lock comment"),
+            self.tr("Subversion Lock"),
+            self.tr("Enter lock comment"),
             QLineEdit.Normal)
         
         if not ok:
@@ -2246,7 +2246,7 @@
         client = self.getClient()
         dlg = \
             SvnDialog(
-                self.trUtf8('Locking in the Subversion repository'),
+                self.tr('Locking in the Subversion repository'),
                 "lock{0}{1} {2}".format(
                     stealIt and " --force" or "",
                     comment and (" --message {0}".format(comment)) or "",
@@ -2286,7 +2286,7 @@
         client = self.getClient()
         dlg = \
             SvnDialog(
-                self.trUtf8('Unlocking in the Subversion repository'),
+                self.tr('Unlocking in the Subversion repository'),
                 "unlock{0} {1}".format(
                     breakIt and " --force" or "",
                     " ".join(fnames)),
@@ -2333,7 +2333,7 @@
                                                     projectPath)
             client = self.getClient()
             dlg = \
-                SvnDialog(self.trUtf8('Relocating'), msg, client)
+                SvnDialog(self.tr('Relocating'), msg, client)
             QApplication.processEvents()
             locker = QMutexLocker(self.vcsExecutionMutex)
             try:
@@ -2361,8 +2361,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
@@ -2384,7 +2384,7 @@
             names = [names]
         client = self.getClient()
         dlg = \
-            SvnDialog(self.trUtf8('Remove from changelist'),
+            SvnDialog(self.tr('Remove from changelist'),
                       "changelist --remove {0}".format(" ".join(names)),
                       client)
         QApplication.processEvents()
@@ -2412,8 +2412,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:
@@ -2421,7 +2421,7 @@
 
         client = self.getClient()
         dlg = \
-            SvnDialog(self.trUtf8('Add to changelist'),
+            SvnDialog(self.tr('Add to changelist'),
                       "changelist {0}".format(" ".join(names)),
                       client)
         QApplication.processEvents()
@@ -2480,7 +2480,7 @@
         """
         client = self.getClient()
         dlg = \
-            SvnDialog(self.trUtf8('Upgrade'),
+            SvnDialog(self.tr('Upgrade'),
                       "upgrade {0}".format(path),
                       client)
         QApplication.processEvents()

eric ide

mercurial