eric6/Plugins/VcsPlugins/vcsSubversion/subversion.py

changeset 7262
c4b5f3393d63
parent 7229
53054eb5b15a
child 7360
9190402e4505
diff -r 3ead033becb8 -r c4b5f3393d63 eric6/Plugins/VcsPlugins/vcsSubversion/subversion.py
--- a/eric6/Plugins/VcsPlugins/vcsSubversion/subversion.py	Tue Sep 24 18:42:25 2019 +0200
+++ b/eric6/Plugins/VcsPlugins/vcsSubversion/subversion.py	Tue Sep 24 18:45:33 2019 +0200
@@ -158,8 +158,9 @@
         if procStarted:
             finished = process.waitForFinished(30000)
             if finished and process.exitCode() == 0:
-                output = \
-                    str(process.readAllStandardOutput(), ioEncoding, 'replace')
+                output = str(process.readAllStandardOutput(),
+                             ioEncoding,
+                             'replace')
                 self.versionStr = output.split()[2]
                 v = list(re.match(r'.*?(\d+)\.(\d+)\.?(\d+)?', self.versionStr)
                          .groups())
@@ -175,8 +176,8 @@
             else:
                 if finished:
                     errMsg = self.tr(
-                        "The svn process finished with the exit code {0}")\
-                        .format(process.exitCode())
+                        "The svn process finished with the exit code {0}"
+                    ).format(process.exitCode())
                 else:
                     errMsg = self.tr(
                         "The svn process did not finish within 30s.")
@@ -354,8 +355,10 @@
             if tag is None or tag == '':
                 svnUrl = '{0}/trunk'.format(vcsDir)
             else:
-                if not tag.startswith('tags') and \
-                        not tag.startswith('branches'):
+                if (
+                    not tag.startswith('tags') and
+                    not tag.startswith('branches')
+                ):
                     tagType, ok = QInputDialog.getItem(
                         None,
                         self.tr("Subversion Checkout"),
@@ -410,8 +413,10 @@
             if tag is None or tag == '':
                 svnUrl = '{0}/trunk'.format(vcsDir)
             else:
-                if not tag.startswith('tags') and \
-                        not tag.startswith('branches'):
+                if (
+                    not tag.startswith('tags') and
+                    not tag.startswith('branches')
+                ):
                     tagType, ok = QInputDialog.getItem(
                         None,
                         self.tr("Subversion Export"),
@@ -491,13 +496,15 @@
                 if os.path.isdir(nam):
                     project = e5App().getObject("Project")
                     if nam == project.getProjectPath():
-                        ok &= project.checkAllScriptsDirty(
-                            reportSyntaxErrors=True) and \
+                        ok &= (
+                            project.checkAllScriptsDirty(
+                                reportSyntaxErrors=True) and
                             project.checkDirty()
+                        )
                         continue
                 elif os.path.isfile(nam):
-                    editor = e5App().getObject("ViewManager")\
-                        .getOpenEditor(nam)
+                    editor = e5App().getObject("ViewManager").getOpenEditor(
+                        nam)
                     if editor:
                         ok &= editor.checkDirty()
                 if not ok:
@@ -517,8 +524,9 @@
         if self.__commitDialog is not None:
             msg = self.__commitDialog.logMessage()
             if self.__commitDialog.hasChangelists():
-                changelists, keepChangelists = \
+                changelists, keepChangelists = (
                     self.__commitDialog.changelistsData()
+                )
             else:
                 changelists, keepChangelists = [], False
             self.__commitDialog.deleteLater()
@@ -547,8 +555,10 @@
             dname, fname = self.splitPath(name)
             args.append(fname)
         
-        if self.svnGetReposName(dname).startswith('http') or \
-           self.svnGetReposName(dname).startswith('svn'):
+        if (
+            self.svnGetReposName(dname).startswith('http') or
+            self.svnGetReposName(dname).startswith('svn')
+        ):
             noDialog = False
         
         if noDialog:
@@ -635,10 +645,12 @@
                 repodir = os.path.dirname(repodir)
                 if os.path.splitdrive(repodir)[1] == os.sep:
                     return  # oops, project is not version controlled
-            while os.path.normcase(dname) != os.path.normcase(repodir) and \
-                    (os.path.normcase(dname) not in self.statusCache or
-                     self.statusCache[os.path.normcase(dname)] ==
-                        self.canBeAdded):
+            while (
+                os.path.normcase(dname) != os.path.normcase(repodir) and
+                (os.path.normcase(dname) not in self.statusCache or
+                 self.statusCache[os.path.normcase(dname)] ==
+                 self.canBeAdded)
+            ):
                 # add directories recursively, if they aren't in the
                 # repository already
                 tree.insert(-1, dname)
@@ -664,12 +676,13 @@
                         repodir = os.path.dirname(repodir)
                         if os.path.splitdrive(repodir)[1] == os.sep:
                             return  # oops, project is not version controlled
-                    while os.path.normcase(d) != \
-                        os.path.normcase(repodir) and \
-                            (d not in tree2 + tree) and \
-                            (os.path.normcase(d) not in self.statusCache or
-                             self.statusCache[os.path.normcase(d)] ==
-                                self.canBeAdded):
+                    while (
+                        os.path.normcase(d) != os.path.normcase(repodir) and
+                        (d not in tree2 + tree) and
+                        (os.path.normcase(d) not in self.statusCache or
+                         self.statusCache[os.path.normcase(d)] ==
+                         self.canBeAdded)
+                    ):
                         tree2.append(d)
                         d = os.path.dirname(d)
                 else:
@@ -729,12 +742,13 @@
                         repodir = os.path.dirname(repodir)
                         if os.path.splitdrive(repodir)[1] == os.sep:
                             return  # oops, project is not version controlled
-                    while os.path.normcase(d) != \
-                        os.path.normcase(repodir) and \
-                            (d not in tree) and \
-                            (os.path.normcase(d) not in self.statusCache or
-                             self.statusCache[os.path.normcase(d)] ==
-                                self.canBeAdded):
+                    while (
+                        os.path.normcase(d) != os.path.normcase(repodir) and
+                        (d not in tree) and
+                        (os.path.normcase(d) not in self.statusCache or
+                         self.statusCache[os.path.normcase(d)] ==
+                         self.canBeAdded)
+                    ):
                         tree.append(d)
                         d = os.path.dirname(d)
                 else:
@@ -754,11 +768,12 @@
                     repodir = os.path.dirname(repodir)
                     if os.path.splitdrive(repodir)[1] == os.sep:
                         return  # oops, project is not version controlled
-                while os.path.normcase(dname) != \
-                    os.path.normcase(repodir) and \
-                        (os.path.normcase(dname) not in self.statusCache or
-                         self.statusCache[os.path.normcase(dname)] ==
-                            self.canBeAdded):
+                while (
+                    os.path.normcase(dname) != os.path.normcase(repodir) and
+                    (os.path.normcase(dname) not in self.statusCache or
+                     self.statusCache[os.path.normcase(dname)] ==
+                     self.canBeAdded)
+                ):
                     # add directories recursively, if they aren't in the
                     # repository already
                     tree.insert(-1, dname)
@@ -1040,8 +1055,9 @@
         project = e5App().getObject("Project")
         names = [project.getRelativePath(nam) for nam in names]
         if names[0]:
-            from UI.DeleteFilesConfirmationDialog import \
+            from UI.DeleteFilesConfirmationDialog import (
                 DeleteFilesConfirmationDialog
+            )
             dlg = DeleteFilesConfirmationDialog(
                 self.parent(),
                 self.tr("Revert changes"),
@@ -1571,14 +1587,18 @@
                         elif commitFound:
                             info['committed-rev'] = rev
                     elif line.startswith('<url>'):
-                        info['url'] = \
+                        info['url'] = (
                             line.replace('<url>', '').replace('</url>', '')
+                        )
                     elif line.startswith('<author>'):
-                        info['last-author'] = line.replace('<author>', '')\
+                        info['last-author'] = (
+                            line.replace('<author>', '')
                             .replace('</author>', '')
+                        )
                     elif line.startswith('<date>'):
-                        value = line.replace('<date>', '')\
-                            .replace('</date>', '')
+                        value = (
+                            line.replace('<date>', '').replace('</date>', '')
+                        )
                         date, time = value.split('T')
                         info['committed-date'] = date
                         info['committed-time'] = "{0}{1}".format(
@@ -1634,8 +1654,9 @@
                 for line in output.splitlines():
                     line = line.strip()
                     if line.startswith('<url>'):
-                        reposURL = line.replace('<url>', '')\
-                            .replace('</url>', '')
+                        reposURL = (
+                            line.replace('<url>', '').replace('</url>', '')
+                        )
                         return reposURL
         
         return ""
@@ -1698,9 +1719,11 @@
             if res:
                 dia.exec_()
                 res = dia.normalExit()
-                if res and \
-                   not rx_prot.exactMatch(target) and \
-                   target.startswith(project.getProjectPath()):
+                if (
+                    res and
+                    not rx_prot.exactMatch(target) and
+                    target.startswith(project.getProjectPath())
+                ):
                     if os.path.isdir(name):
                         project.copyDirectory(name, target)
                     else:
@@ -2256,10 +2279,9 @@
         if procStarted:
             finished = process.waitForFinished(30000)
             if finished and process.exitCode() == 0:
-                output = \
-                    str(process.readAllStandardOutput(),
-                        Preferences.getSystem("IOEncoding"),
-                        'replace')
+                output = str(process.readAllStandardOutput(),
+                             Preferences.getSystem("IOEncoding"),
+                             'replace')
                 if output:
                     for line in output.splitlines():
                         if rx_changelist.exactMatch(line):
@@ -2362,15 +2384,16 @@
         """
         helper = self.__plugin.getProjectHelper()
         helper.setObjects(self, project)
-        self.__wcng = \
+        self.__wcng = (
             os.path.exists(
-                os.path.join(project.getProjectPath(), ".svn", "format")) or \
+                os.path.join(project.getProjectPath(), ".svn", "format")) or
             os.path.exists(
-                os.path.join(project.getProjectPath(), "_svn", "format")) or \
+                os.path.join(project.getProjectPath(), "_svn", "format")) or
             os.path.exists(
-                os.path.join(project.getProjectPath(), ".svn", "wc.db")) or \
+                os.path.join(project.getProjectPath(), ".svn", "wc.db")) or
             os.path.exists(
                 os.path.join(project.getProjectPath(), "_svn", "wc.db"))
+        )
         return helper
 
     ###########################################################################

eric ide

mercurial