Did some more string format conversions.

Wed, 28 Jul 2010 09:10:19 +0200

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 28 Jul 2010 09:10:19 +0200
changeset 424
d0915392cbd7
parent 422
dd7c1558b1df
child 425
ca5e65413fc5

Did some more string format conversions.

Plugins/VcsPlugins/vcsPySvn/SvnBlameDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsPySvn/SvnDiffDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsPySvn/SvnLogBrowserDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsPySvn/SvnLogDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsPySvn/SvnNewProjectOptionsDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsPySvn/SvnOptionsDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsPySvn/SvnRepoBrowserDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsPySvn/SvnRevisionSelectionDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsPySvn/SvnStatusDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsPySvn/SvnStatusMonitorThread.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsPySvn/SvnTagBranchListDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsPySvn/subversion.py file | annotate | diff | comparison | revisions
--- a/Plugins/VcsPlugins/vcsPySvn/SvnBlameDialog.py	Tue Jul 27 19:53:26 2010 +0200
+++ b/Plugins/VcsPlugins/vcsPySvn/SvnBlameDialog.py	Wed Jul 28 09:10:19 2010 +0200
@@ -121,7 +121,7 @@
         @param text line of text from the annotated file (string)
         """
         itm = QTreeWidgetItem(self.blameList, 
-            ["%d" % revision, author, "%d" % lineno, text])
+            ["{0:d}".format(revision), author, "{0:d}".format(lineno), text])
         itm.setTextAlignment(0, Qt.AlignRight)
         itm.setTextAlignment(2, Qt.AlignRight)
         
--- a/Plugins/VcsPlugins/vcsPySvn/SvnDiffDialog.py	Tue Jul 27 19:53:26 2010 +0200
+++ b/Plugins/VcsPlugins/vcsPySvn/SvnDiffDialog.py	Wed Jul 28 09:10:19 2010 +0200
@@ -190,8 +190,8 @@
             for name in fnames:
                 self.__showError(self.trUtf8("Processing file '{0}'...\n").format(name))
                 if urls is not None:
-                    url1 = "%s/%s%s" % (urls[0], dname, name)
-                    url2 = "%s/%s%s" % (urls[1], dname, name)
+                    url1 = "{0}/{1}{2}".format(urls[0], dname, name)
+                    url2 = "{0}/{1}{2}".format(urls[1], dname, name)
                     if summary:
                         diff_summary = self.client.diff_summarize(\
                             url1, revision1 = rev1, 
@@ -199,9 +199,9 @@
                             recurse = recurse)
                         diff_list = []
                         for diff_sum in diff_summary:
-                            diff_list.append("%s %s" % \
-                                (self.__getDiffSummaryKind(diff_sum['summarize_kind']),
-                                 diff_sum['path']))
+                            diff_list.append("{0} {1}".format(
+                                self.__getDiffSummaryKind(diff_sum['summarize_kind']),
+                                diff_sum['path']))
                         diffText = os.linesep.join(diff_list)
                     else:
                         diffText = self.client.diff(tmpdir, 
@@ -218,7 +218,7 @@
                             revision1 = rev1, revision2 = rev2, recurse = recurse)
                 counter = 0
                 for line in diffText.splitlines():
-                    self.__appendText("%s%s" % (line, os.linesep))
+                    self.__appendText("{0}{1}".format(line, os.linesep))
                     counter += 1
                     if counter == 30:
                         # check for cancel every 30 lines
@@ -306,7 +306,7 @@
             else:
                 dname, fname = self.vcs.splitPath(self.filename[0])
                 if fname != '.':
-                    fname = "%s.diff" % self.filename[0]
+                    fname = "{0}.diff".format(self.filename[0])
                 else:
                     fname = dname
         else:
@@ -359,4 +359,4 @@
         """
         self.errorGroup.show()
         self.errors.insertPlainText(msg)
-        self.errors.ensureCursorVisible()
\ No newline at end of file
+        self.errors.ensureCursorVisible()
--- a/Plugins/VcsPlugins/vcsPySvn/SvnLogBrowserDialog.py	Tue Jul 27 19:53:26 2010 +0200
+++ b/Plugins/VcsPlugins/vcsPySvn/SvnLogBrowserDialog.py	Wed Jul 28 09:10:19 2010 +0200
@@ -138,7 +138,7 @@
             rev = ""
             self.__lastRev = 0
         else:
-            rev = "%7d" % revision.number
+            rev = "{0:7d}".format(revision.number)
             self.__lastRev = revision.number
         if date == "":
             dt = ""
@@ -158,7 +158,7 @@
             if changedPath["copyfrom_revision"] is None:
                 copyRev = ""
             else:
-                copyRev = "%7d" % changedPath["copyfrom_revision"].number
+                copyRev = "{0:7d}".format(changedPath["copyfrom_revision"].number)
             change = {
                 "action"            : changedPath["action"], 
                 "path"              : changedPath["path"], 
@@ -475,7 +475,7 @@
                 fieldIndex = 0
                 txt = self.rxEdit.text()
                 if txt.startswith("^"):
-                    searchRx = QRegExp("^\s*%s" % txt[1:], Qt.CaseInsensitive)
+                    searchRx = QRegExp("^\s*{0}".format(txt[1:]), Qt.CaseInsensitive)
                 else:
                     searchRx = QRegExp(txt, Qt.CaseInsensitive)
             else:
--- a/Plugins/VcsPlugins/vcsPySvn/SvnLogDialog.py	Tue Jul 27 19:53:26 2010 +0200
+++ b/Plugins/VcsPlugins/vcsPySvn/SvnLogDialog.py	Wed Jul 28 09:10:19 2010 +0200
@@ -123,19 +123,19 @@
             self.contents.clear()
             self.__pegRev = None
             for log in logs:
-                ver = "%d" % log["revision"].number
+                ver = "{0:d}".format(log["revision"].number)
                 dstr = '<b>{0} {1}</b>'.format(self.revString, ver)
                 if self.__pegRev is None:
                     self.__pegRev = int(ver)
                 try:
-                    lv = "%d" % logs[logs.index(log) + 1]["revision"].number
+                    lv = "{0:d}".format(logs[logs.index(log) + 1]["revision"].number)
                     url = QUrl()
                     url.setScheme("file")
                     url.setPath(self.filename)
                     query = QByteArray()
                     query.append(lv).append('_').append(ver)
                     url.setEncodedQuery(query)
-                    dstr += ' [<a href="%s" name="%s">%s</a>]' % (
+                    dstr += ' [<a href="{0}" name="{1}">{2}</a>]'.format(
                         url.toString(), query, self.trUtf8('diff to {0}').format(lv)
                     )
                 except IndexError:
--- a/Plugins/VcsPlugins/vcsPySvn/SvnNewProjectOptionsDialog.py	Tue Jul 27 19:53:26 2010 +0200
+++ b/Plugins/VcsPlugins/vcsPySvn/SvnNewProjectOptionsDialog.py	Wed Jul 28 09:10:19 2010 +0200
@@ -127,10 +127,10 @@
         scheme = self.protocolCombo.currentText()
         url = self.vcsUrlEdit.text()
         if scheme == "file://" and url[0] not in ["\\", "/"]:
-            url = "/%s" % url
+            url = "/{0}".format(url)
         vcsdatadict = {
-            "url" : '%s%s' % (scheme, url),
+            "url" : '{0}{1}'.format(scheme, url),
             "tag" : self.vcsTagEdit.text(), 
             "standardLayout" : self.layoutCheckBox.isChecked(),
         }
-        return (self.vcsProjectDirEdit.text(), vcsdatadict)
\ No newline at end of file
+        return (self.vcsProjectDirEdit.text(), vcsdatadict)
--- a/Plugins/VcsPlugins/vcsPySvn/SvnOptionsDialog.py	Tue Jul 27 19:53:26 2010 +0200
+++ b/Plugins/VcsPlugins/vcsPySvn/SvnOptionsDialog.py	Wed Jul 28 09:10:19 2010 +0200
@@ -102,10 +102,10 @@
         scheme = self.protocolCombo.currentText()
         url = self.vcsUrlEdit.text()
         if scheme == "file://" and url[0] not in ["\\", "/"]:
-            url = "/%s" % url
+            url = "/{0}".format(url)
         vcsdatadict = {
-            "url" : '%s%s' % (scheme, url),
+            "url" : '{0}{1}'.format(scheme, url),
             "message" : self.vcsLogEdit.text(),
             "standardLayout" : self.layoutCheckBox.isChecked(),
         }
-        return vcsdatadict
\ No newline at end of file
+        return vcsdatadict
--- a/Plugins/VcsPlugins/vcsPySvn/SvnRepoBrowserDialog.py	Tue Jul 27 19:53:26 2010 +0200
+++ b/Plugins/VcsPlugins/vcsPySvn/SvnRepoBrowserDialog.py	Wed Jul 28 09:10:19 2010 +0200
@@ -102,7 +102,7 @@
         if revision == "":
             rev = ""
         else:
-            rev = "%7d" % revision.number
+            rev = "{0:7d}".format(revision.number)
         if date == "":
             dt = ""
         else:
@@ -110,7 +110,7 @@
         if size == 0:
             sz = ""
         else:
-            sz = "%7d" % size
+            sz = "{0:7d}".format(size)
         if author is None:
             author = ""
         
@@ -170,7 +170,7 @@
                             urlPart = repoUrl
                             for element in dirent["repos_path"].split("/")[:-1]:
                                 if element:
-                                    urlPart = "%s/%s" % (urlPart, element)
+                                    urlPart = "{0}/{1}".format(urlPart, element)
                                     itm = self.__generateItem(parent, element, 
                                         "", "", 0, "", pysvn.node_kind.dir, 
                                         urlPart)
--- a/Plugins/VcsPlugins/vcsPySvn/SvnRevisionSelectionDialog.py	Tue Jul 27 19:53:26 2010 +0200
+++ b/Plugins/VcsPlugins/vcsPySvn/SvnRevisionSelectionDialog.py	Wed Jul 28 09:10:19 2010 +0200
@@ -62,8 +62,8 @@
         if numberButton.isChecked():
             return numberSpinBox.value()
         elif dateButton.isChecked():
-            return "{%s}" % \
-                QDateTime(dateEdit.date(), timeEdit.time()).toString(Qt.ISODate)
+            return "{{{0}}}".format(
+                QDateTime(dateEdit.date(), timeEdit.time()).toString(Qt.ISODate))
         elif headButton.isChecked():
             return "HEAD"
         elif workingButton.isChecked():
--- a/Plugins/VcsPlugins/vcsPySvn/SvnStatusDialog.py	Tue Jul 27 19:53:26 2010 +0200
+++ b/Plugins/VcsPlugins/vcsPySvn/SvnStatusDialog.py	Wed Jul 28 09:10:19 2010 +0200
@@ -183,8 +183,8 @@
             self.yesno[switched], 
             self.lockinfo[lockinfo], 
             self.yesno[uptodate], 
-            "%7s" % str(revision), 
-            "%7s" % str(change), 
+            "{0:7}".format(str(revision)), 
+            "{0:7}".format(str(change)), 
             author, 
             path, 
         ])
--- a/Plugins/VcsPlugins/vcsPySvn/SvnStatusMonitorThread.py	Tue Jul 27 19:53:26 2010 +0200
+++ b/Plugins/VcsPlugins/vcsPySvn/SvnStatusMonitorThread.py	Wed Jul 28 09:10:19 2010 +0200
@@ -94,12 +94,12 @@
                     states[file.path] = status
                     try:
                         if self.reportedStates[file.path] != status:
-                            self.statusList.append("%s %s" % (status, file.path))
+                            self.statusList.append("{0} {1}".format(status, file.path))
                     except KeyError:
-                        self.statusList.append("%s %s" % (status, file.path))
+                        self.statusList.append("{0} {1}".format(status, file.path))
             for name in list(self.reportedStates.keys()):
                 if name not in states:
-                    self.statusList.append("  %s" % name)
+                    self.statusList.append("  {0}".format(name))
             self.reportedStates = states
             res = True
             statusStr = \
--- a/Plugins/VcsPlugins/vcsPySvn/SvnTagBranchListDialog.py	Tue Jul 27 19:53:26 2010 +0200
+++ b/Plugins/VcsPlugins/vcsPySvn/SvnTagBranchListDialog.py	Wed Jul 28 09:10:19 2010 +0200
@@ -91,9 +91,9 @@
             reposRoot = rx_base.cap(1)
             
             if tags:
-                path = "%s/tags" % reposRoot
+                path = "{0}/tags".format(reposRoot)
             else:
-                path = "%s/branches" % reposRoot
+                path = "{0}/branches".format(reposRoot)
         else:
             reposPath, ok = QInputDialog.getText(\
                 self,
@@ -202,7 +202,8 @@
         @param date date of the tag (string)
         @param name name (path) of the tag (string)
         """
-        itm = QTreeWidgetItem(self.tagList, ["%6d" % revision, author, date, name])
+        itm = QTreeWidgetItem(self.tagList, 
+                              ["{0:6d}".format(revision), author, date, name])
         itm.setTextAlignment(0, Qt.AlignRight)
         
     def getTagList(self):
--- a/Plugins/VcsPlugins/vcsPySvn/subversion.py	Tue Jul 27 19:53:26 2010 +0200
+++ b/Plugins/VcsPlugins/vcsPySvn/subversion.py	Wed Jul 28 09:10:19 2010 +0200
@@ -219,7 +219,7 @@
             if os.getcwd() == project.ppath:
                 os.chdir(os.path.dirname(project.ppath))
                 cwdIsPpath = True
-            tmpProjectDir = "%s_tmp" % project.ppath
+            tmpProjectDir = "{0}_tmp".format(project.ppath)
             shutil.rmtree(tmpProjectDir, True)
             os.rename(project.ppath, tmpProjectDir)
             os.makedirs(project.ppath)
@@ -270,14 +270,14 @@
         
         vcsDir = self.svnNormalizeURL(vcsDataDict["url"])
         if vcsDir.startswith('/'):
-            vcsDir = 'file://%s' % vcsDir
+            vcsDir = 'file://{0}'.format(vcsDir)
         elif vcsDir[1] in ['|', ':']:
-            vcsDir = 'file:///%s' % vcsDir
+            vcsDir = 'file:///{0}'.format(vcsDir)
         
         project = vcsDir[vcsDir.rfind('/') + 1:]
         
         # create the dir structure to be imported into the repository
-        tmpDir = '%s_tmp' % projectDir
+        tmpDir = '{0}_tmp'.format(projectDir)
         try:
             os.makedirs(tmpDir)
             if self.otherData["standardLayout"]:
@@ -302,9 +302,9 @@
         if not noDialog:
             dlg = \
                 SvnDialog(self.trUtf8('Importing project into Subversion repository'),
-                          "import%s --message %s ." % \
-                            ((not recurse) and " --non-recursive" or "", 
-                             msg),
+                          "import{0} --message {1} .".format(
+                            (not recurse) and " --non-recursive" or "", 
+                            msg),
                     client)
             QApplication.processEvents()
         try:
@@ -342,13 +342,13 @@
             tag = None
         vcsDir = self.svnNormalizeURL(vcsDataDict["url"])
         if vcsDir.startswith('/'):
-            vcsDir = 'file://%s' % vcsDir
+            vcsDir = 'file://{0}'.format(vcsDir)
         elif vcsDir[1] in ['|', ':']:
-            vcsDir = 'file:///%s' % vcsDir
+            vcsDir = 'file:///{0}'.format(vcsDir)
             
         if self.otherData["standardLayout"]:
             if tag is None or tag == '':
-                svnUrl = '%s/trunk' % vcsDir
+                svnUrl = '{0}/trunk'.format(vcsDir)
             else:
                 if not tag.startswith('tags') and not tag.startswith('branches'):
                     type_, ok = QInputDialog.getItem(\
@@ -361,8 +361,8 @@
                         0, False)
                     if not ok:
                         return False
-                    tag = '%s/%s' % (type_, tag)
-                svnUrl = '%s/%s' % (vcsDir, tag)
+                    tag = '{0}/{1}'.format(type_, tag)
+                svnUrl = '{0}/{1}'.format(vcsDir, tag)
         else:
             svnUrl = vcsDir
         
@@ -373,9 +373,9 @@
         if not noDialog:
             dlg = \
                 SvnDialog(self.trUtf8('Checking project out of Subversion repository'),
-                          "checkout%s %s %s" % \
-                            ((not recurse) and " --non-recursive" or "", 
-                             url, projectDir),
+                          "checkout{0} {1} {2}".format(
+                            (not recurse) and " --non-recursive" or "", 
+                            url, projectDir),
                     client)
             QApplication.processEvents()
         locker = QMutexLocker(self.vcsExecutionMutex)
@@ -406,11 +406,11 @@
             tag = None
         vcsDir = self.svnNormalizeURL(vcsDataDict["url"])
         if vcsDir.startswith('/') or vcsDir[1] == '|':
-            vcsDir = 'file://%s' % vcsDir
+            vcsDir = 'file://{0}'.format(vcsDir)
             
         if self.otherData["standardLayout"]:
             if tag is None or tag == '':
-                svnUrl = '%s/trunk' % vcsDir
+                svnUrl = '{0}/trunk'.format(vcsDir)
             else:
                 if not tag.startswith('tags') and not tag.startswith('branches'):
                     type_, ok = QInputDialog.getItem(\
@@ -423,8 +423,8 @@
                         0, False)
                     if not ok:
                         return False
-                    tag = '%s/%s' % (type_, tag)
-                svnUrl = '%s/%s' % (vcsDir, tag)
+                    tag = '{0}/{1}'.format(type_, tag)
+                svnUrl = '{0}/{1}'.format(vcsDir, tag)
         else:
             svnUrl = vcsDir
         
@@ -434,9 +434,9 @@
         client = self.getClient()
         dlg = \
             SvnDialog(self.trUtf8('Exporting project from Subversion repository'),
-                      "export --force%s %s %s" % \
-                        ((not recurse) and " --non-recursive" or "",
-                         url, projectDir),
+                      "export --force{0} {1} {2}".format(
+                        (not recurse) and " --non-recursive" or "",
+                        url, projectDir),
                 client)
         QApplication.processEvents()
         locker = QMutexLocker(self.vcsExecutionMutex)
@@ -520,13 +520,13 @@
         if not noDialog:
             dlg = \
                 SvnDialog(self.trUtf8('Commiting changes to Subversion repository'),
-                          "commit%s%s%s%s --message %s %s" % \
-                            ((not recurse) and " --non-recursive" or "",
-                             keeplocks and " --keep-locks" or "",
-                             keepChangelists and " --keep-changelists" or "", 
-                             changelists and \
+                          "commit{0}{1}{2}{3} --message {4} {5}".format(
+                            (not recurse) and " --non-recursive" or "",
+                            keeplocks and " --keep-locks" or "",
+                            keepChangelists and " --keep-changelists" or "", 
+                            changelists and \
                                 " --changelist ".join([""] + changelists) or "", 
-                             msg, " ".join(fnames)),
+                            msg, " ".join(fnames)),
                     client)
             QApplication.processEvents()
         try:
@@ -576,7 +576,8 @@
         if not noDialog:
             dlg = \
                 SvnDialog(self.trUtf8('Synchronizing with the Subversion repository'),
-                          "update%s %s" % ((not recurse) and " --non-recursive" or "",
+                          "update{0} {1}".format(
+                            (not recurse) and " --non-recursive" or "",
                             " ".join(fnames)),
                     client)
         QApplication.processEvents()
@@ -650,10 +651,10 @@
             dlg = \
                 SvnDialog(\
                     self.trUtf8('Adding files/directories to the Subversion repository'),
-                        "add --non-recursive%s%s %s" % \
-                            (force and " --force" or "",
-                             noignore and " --no-ignore" or "",
-                             " ".join(names)),
+                        "add --non-recursive{0}{1} {2}".format(
+                            force and " --force" or "",
+                            noignore and " --no-ignore" or "",
+                            " ".join(names)),
                     client)
             QApplication.processEvents()
         try:
@@ -723,10 +724,10 @@
         dlg = \
             SvnDialog(\
                 self.trUtf8('Adding directory trees to the Subversion repository'),
-                    "add%s%s %s" % \
-                        (force and " --force" or "",
-                         ignore and " --ignore" or "",
-                         " ".join(names)),
+                    "add{0}{1} {2}".format(
+                        force and " --force" or "",
+                        ignore and " --ignore" or "",
+                        " ".join(names)),
                 client)
         QApplication.processEvents()
         try:
@@ -758,9 +759,9 @@
             dlg = \
                 SvnDialog(\
                     self.trUtf8('Removing files/directories from the Subversion repository'),
-                        "remove%s %s" % \
-                            (force and " --force" or "",
-                             " ".join(name)),
+                        "remove{0} {1}".format(
+                            force and " --force" or "",
+                            " ".join(name)),
                     client)
             QApplication.processEvents()
         locker = QMutexLocker(self.vcsExecutionMutex)
@@ -812,7 +813,7 @@
             client = self.getClient()
             if rx_prot.exactMatch(target):
                 target = self.__svnURL(target)
-                log = "Moving %s to %s" % (name, target)
+                log = "Moving {0} to {1}".format(name, target)
             else:
                 log = ""
                 target = target
@@ -820,9 +821,9 @@
                 dlg = \
                     SvnDialog(\
                         self.trUtf8('Moving {0}').format(name),
-                            "move%s%s %s %s" % \
-                                (force and " --force" or "",
-                                log and (" --message %s" % log) or "", 
+                            "move{0}{1} {2} {3}".format(
+                                force and " --force" or "",
+                                log and (" --message {0}".format(log)) or "", 
                                 name, target),
                         client, log = log)
                 QApplication.processEvents()
@@ -949,9 +950,9 @@
             
             reposRoot = rx_base.cap(1)
             if tagOp in [1, 4]:
-                url = '%s/tags/%s' % (reposRoot, urllib.parse.quote(tag))
+                url = '{0}/tags/{1}'.format(reposRoot, urllib.parse.quote(tag))
             elif tagOp in [2, 8]:
-                url = '%s/branches/%s' % (reposRoot, urllib.parse.quote(tag))
+                url = '{0}/branches/{1}'.format(reposRoot, urllib.parse.quote(tag))
         else:
             url = self.__svnURL(tag)
         
@@ -959,11 +960,11 @@
         client = self.getClient()
         rev = None
         if tagOp in [1, 2]:
-            log = 'Created tag <%s>' % self.tagName
+            log = 'Created tag <{0}>'.format(self.tagName)
             dlg = \
                 SvnDialog(\
                     self.trUtf8('Tagging {0} in the Subversion repository').format(name),
-                        "copy --message %s %s %s" % (log, reposURL, url),
+                        "copy --message {0} {1} {2}".format(log, reposURL, url),
                     client, log = log)
             QApplication.processEvents()
             locker = QMutexLocker(self.vcsExecutionMutex)
@@ -973,11 +974,11 @@
                 dlg.showError(e.args[0])
             locker.unlock()
         else:
-            log = 'Deleted tag <%s>' % self.tagName
+            log = 'Deleted tag <{0}>'.format(self.tagName)
             dlg = \
                 SvnDialog(\
                     self.trUtf8('Tagging {0} in the Subversion repository').format(name),
-                        "remove --message %s %s" % (log, url),
+                        "remove --message {0} {1}".format(log, url),
                     client, log = log)
             QApplication.processEvents()
             locker = QMutexLocker(self.vcsExecutionMutex)
@@ -1005,7 +1006,7 @@
         client = self.getClient()
         dlg = \
             SvnDialog(self.trUtf8('Reverting changes'),
-                      "revert %s %s" % ((not recurse) and " --non-recursive" or "",
+                      "revert {0} {1}".format((not recurse) and " --non-recursive" or "",
                         " ".join(name)),
                 client)
         QApplication.processEvents()
@@ -1063,11 +1064,11 @@
             reposRoot = rx_base.cap(1)
             tn = tag
             if tagType == 1:
-                url = '%s/tags/%s' % (reposRoot, urllib.parse.quote(tag))
+                url = '{0}/tags/{1}'.format(reposRoot, urllib.parse.quote(tag))
             elif tagType == 2:
-                url = '%s/branches/%s' % (reposRoot, urllib.parse.quote(tag))
+                url = '{0}/branches/{1}'.format(reposRoot, urllib.parse.quote(tag))
             elif tagType == 4:
-                url = '%s/trunk' % (reposRoot)
+                url = '{0}/trunk'.format(reposRoot)
                 tn = 'HEAD'
         else:
             url = self.__svnURL(tag)
@@ -1076,7 +1077,7 @@
         client = self.getClient()
         dlg = \
             SvnDialog(self.trUtf8('Switching to {0}').format(tn),
-                      "switch %s %s" % (url, name),
+                      "switch {0} {1}".format(url, name),
                 client)
         QApplication.processEvents()
         locker = QMutexLocker(self.vcsExecutionMutex)
@@ -1176,12 +1177,12 @@
         dlg = \
             SvnDialog(\
                 self.trUtf8('Merging {0}').format(name),
-                    "merge%s%s %s %s %s" % \
-                        ((not recurse) and " --non-recursive" or "",
-                         force and " --force" or "",
-                         "%s%s" % (url1, rev1 and ("@"+rev1) or ""),
-                         "%s%s" % (url2, rev2 and ("@"+rev2) or ""),
-                         fname),
+                    "merge{0}{1} {2} {3} {4}".format(
+                        (not recurse) and " --non-recursive" or "",
+                        force and " --force" or "",
+                        "{0}{1}".format(url1, rev1 and ("@"+rev1) or ""),
+                        "{0}{1}".format(url2, rev2 and ("@"+rev2) or ""),
+                        fname),
                 client)
         QApplication.processEvents()
         try:
@@ -1295,7 +1296,7 @@
         client = self.getClient()
         dlg = \
             SvnDialog(self.trUtf8('Cleaning up {0}').format(name),
-                      "cleanup %s" % name,
+                      "cleanup {0}".format(name),
                 client)
         QApplication.processEvents()
         locker = QMutexLocker(self.vcsExecutionMutex)
@@ -1367,9 +1368,9 @@
             return e.args[0]
         
         if hasattr(pysvn, 'svn_api_version'):
-            apiVersion = "%s %s" % \
-                (".".join([str(v) for v in pysvn.svn_api_version[:3]]), 
-                 pysvn.svn_api_version[3])
+            apiVersion = "{0} {1}".format(
+                ".".join([str(v) for v in pysvn.svn_api_version[:3]]), 
+                pysvn.svn_api_version[3])
         else:
             apiVersion = QApplication.translate('subversion', "unknown")
         return QApplication.translate('subversion',
@@ -1438,8 +1439,8 @@
         client = self.getClient()
         dlg = \
             SvnDialog(self.trUtf8('Resolving conficts'),
-                      "resolved%s %s" % \
-                        ((not recurse) and " --non-recursive" or "", 
+                      "resolved{0} {1}".format(
+                        (not recurse) and " --non-recursive" or "", 
                         " ".join(fnames)),
                 client)
         QApplication.processEvents()
@@ -1471,15 +1472,15 @@
             client = self.getClient()
             if rx_prot.exactMatch(target):
                 target = self.__svnURL(target)
-                log = "Copying %s to %s" % (name, target)
+                log = "Copying {0} to {1}".format(name, target)
             else:
                 log = ""
                 target = target
             dlg = \
                 SvnDialog(\
                     self.trUtf8('Copying {0}').format(name),
-                        "copy%s %s %s" % \
-                            (log and (" --message %s" % log) or "", 
+                        "copy{0} {1} {2}".format(
+                            log and (" --message {0}".format(log)) or "", 
                             name, target),
                     client, log = log)
             QApplication.processEvents()
@@ -1545,11 +1546,11 @@
             dlg = \
                 SvnDialog(\
                     self.trUtf8('Subversion Set Property'),
-                        "propset%s%s %s %s %s" % \
-                            (recurse and " --recurse" or "",
-                             skipchecks and " --skip-checks" or "",
-                             propName, propValue,
-                             " ".join(fnames)),
+                        "propset{0}{1} {2} {3} {4}".format(
+                            recurse and " --recurse" or "",
+                            skipchecks and " --skip-checks" or "",
+                            propName, propValue,
+                            " ".join(fnames)),
                     client)
             QApplication.processEvents()
             try:
@@ -1596,10 +1597,10 @@
             dlg = \
                 SvnDialog(\
                     self.trUtf8('Subversion Delete Property'),
-                        "propdel%s%s %s %s" % \
-                            (recurse and " --recurse" or "",
-                             skipchecks and " --skip-checks" or "",
-                             propName, " ".join(fnames)),
+                        "propdel{0}{1} {2} {3}".format(
+                            recurse and " --recurse" or "",
+                            skipchecks and " --skip-checks" or "",
+                            propName, " ".join(fnames)),
                     client)
             QApplication.processEvents()
             try:
@@ -1780,10 +1781,10 @@
         dlg = \
             SvnDialog(\
                 self.trUtf8('Locking in the Subversion repository'),
-                    "lock%s%s %s" % \
-                        (stealIt and " --force" or "",
-                         comment and (" --message %s" % comment) or "",
-                         " ".join(fnames)),
+                    "lock{0}{1} {2}".format(
+                        stealIt and " --force" or "",
+                        comment and (" --message {0}".format(comment)) or "",
+                        " ".join(fnames)),
                 client, parent = parent)
         QApplication.processEvents()
         try:
@@ -1818,9 +1819,9 @@
         dlg = \
             SvnDialog(\
                 self.trUtf8('Unlocking in the Subversion repository'),
-                    "unlock%s %s" % \
-                        (breakIt and " --force" or "",
-                         " ".join(fnames)),
+                    "unlock{0} {1}".format(
+                        breakIt and " --force" or "",
+                        " ".join(fnames)),
                 client, parent = parent)
         QApplication.processEvents()
         try:
@@ -1856,9 +1857,9 @@
         if dlg.exec_() == QDialog.Accepted:
             newUrl, inside = dlg.getData()
             if inside:
-                msg = "switch %s %s" % (newUrl, projectPath)
+                msg = "switch {0} {1}".format(newUrl, projectPath)
             else:
-                msg = "relocate %s %s %s" % (currUrl, newUrl, projectPath)
+                msg = "relocate {0} {1} {2}".format(currUrl, newUrl, projectPath)
             client = self.getClient()
             dlg = \
                 SvnDialog(self.trUtf8('Relocating'), msg, client)
@@ -1912,7 +1913,7 @@
         client = self.getClient()
         dlg = \
             SvnDialog(self.trUtf8('Remove from changelist'),
-                      "changelist --remove %s" % " ".join(names),
+                      "changelist --remove {0}".format(" ".join(names)),
                       client)
         QApplication.processEvents()
         locker = QMutexLocker(self.vcsExecutionMutex)
@@ -1948,7 +1949,7 @@
         client = self.getClient()
         dlg = \
             SvnDialog(self.trUtf8('Add to changelist'),
-                      "changelist %s" % " ".join(names),
+                      "changelist {0}".format(" ".join(names)),
                       client)
         QApplication.processEvents()
         locker = QMutexLocker(self.vcsExecutionMutex)
@@ -1978,14 +1979,14 @@
             scheme = url[0]
             host = url[1]
             port, path = url[2].split("/",1)
-            return "%s:%s:%s/%s" % (scheme, host, port, urllib.parse.quote(path))
+            return "{0}:{1}:{2}/{3}".format(scheme, host, port, urllib.parse.quote(path))
         else:
             scheme = url[0]
             if scheme == "file":
-                return "%s:%s" % (scheme, urllib.parse.quote(url[1]))
+                return "{0}:{1}".format(scheme, urllib.parse.quote(url[1]))
             else:
                 host, path = url[1][2:].split("/",1)
-                return "%s://%s/%s" % (scheme, host, urllib.parse.quote(path))
+                return "{0}://{1}/{2}".format(scheme, host, urllib.parse.quote(path))
 
     def svnNormalizeURL(self, url):
         """
@@ -1998,7 +1999,7 @@
         if url.endswith('/'):
             url = url[:-1]
         urll = url.split('//')
-        return "%s//%s" % (urll[0], '/'.join(urll[1:]))
+        return "{0}//{1}".format(urll[0], '/'.join(urll[1:]))
 
     ############################################################################
     ## Methods to get the helper objects are below.

eric ide

mercurial