eric6/Plugins/VcsPlugins/vcsSubversion/subversion.py

branch
maintenance
changeset 8273
698ae46f40a4
parent 8176
31965986ecd1
parent 8259
2bbec88047dd
--- a/eric6/Plugins/VcsPlugins/vcsSubversion/subversion.py	Fri Apr 02 11:59:41 2021 +0200
+++ b/eric6/Plugins/VcsPlugins/vcsSubversion/subversion.py	Sat May 01 14:27:20 2021 +0200
@@ -867,10 +867,8 @@
             if not target:
                 return False
         
-        if rx_prot.fullmatch(target) is None:
-            isDir = os.path.isdir(name)
-        else:
-            isDir = False
+        isDir = (os.path.isdir(name) if rx_prot.fullmatch(target) is None
+                 else False)
         
         if accepted:
             args = []
@@ -919,10 +917,7 @@
         
         @param name file/directory name to be diffed (string)
         """
-        if isinstance(name, list):
-            names = name[:]
-        else:
-            names = [name]
+        names = name[:] if isinstance(name, list) else [name]
         for nam in names:
             if os.path.isfile(nam):
                 editor = e5App().getObject("ViewManager").getOpenEditor(nam)
@@ -975,10 +970,11 @@
                     """ will be aborted"""))
             return
         
-        if self.otherData["standardLayout"]:
-            url = None
-        else:
-            url = self.svnNormalizeURL(reposURL)
+        url = (
+            None
+            if self.otherData["standardLayout"] else
+            self.svnNormalizeURL(reposURL)
+        )
         from .SvnTagDialog import SvnTagDialog
         dlg = SvnTagDialog(self.allTagsBranchesList, url,
                            self.otherData["standardLayout"])
@@ -1098,10 +1094,11 @@
                     """ operation will be aborted"""))
             return False
         
-        if self.otherData["standardLayout"]:
-            url = None
-        else:
-            url = self.svnNormalizeURL(reposURL)
+        url = (
+            None
+            if self.otherData["standardLayout"] else
+            self.svnNormalizeURL(reposURL)
+        )
         from .SvnSwitchDialog import SvnSwitchDialog
         dlg = SvnSwitchDialog(self.allTagsBranchesList, url,
                               self.otherData["standardLayout"])
@@ -1327,7 +1324,7 @@
         dname = os.path.normcase(dname)
         
         found = False
-        for name in self.statusCache.keys():
+        for name in self.statusCache:
             if name in names:
                 found = True
                 names[name] = self.statusCache[name]
@@ -1893,10 +1890,7 @@
         
         @param name file/directory name to be diffed (string)
         """
-        if isinstance(name, list):
-            names = name[:]
-        else:
-            names = [name]
+        names = name[:] if isinstance(name, list) else [name]
         for nam in names:
             if os.path.isfile(nam):
                 editor = e5App().getObject("ViewManager").getOpenEditor(nam)
@@ -1929,10 +1923,7 @@
         
         @param name file/directory name to be diffed (string)
         """
-        if isinstance(name, list):
-            names = name[:]
-        else:
-            names = [name]
+        names = name[:] if isinstance(name, list) else [name]
         for nam in names:
             if os.path.isfile(nam):
                 editor = e5App().getObject("ViewManager").getOpenEditor(nam)
@@ -2168,10 +2159,7 @@
         
         @param projectPath path name of the project (string)
         """
-        if projectPath:
-            url = self.svnGetReposName(projectPath)
-        else:
-            url = None
+        url = self.svnGetReposName(projectPath) if projectPath else None
         
         if url is None:
             url, ok = QInputDialog.getText(

eric ide

mercurial