Fixed a serious bug in the subversion plug-ins and in the project browser model and corrected some source docu.

Sun, 04 Apr 2010 13:57:59 +0000

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 04 Apr 2010 13:57:59 +0000
changeset 169
a03768260179
parent 168
3383117f894b
child 170
a267d9774acf

Fixed a serious bug in the subversion plug-ins and in the project browser model and corrected some source docu.

Plugins/PluginVcsSubversion.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsPySvn/SvnDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsPySvn/subversion.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsSubversion/SvnDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsSubversion/subversion.py file | annotate | diff | comparison | revisions
Project/ProjectBrowserModel.py file | annotate | diff | comparison | revisions
--- a/Plugins/PluginVcsSubversion.py	Fri Apr 02 17:12:47 2010 +0000
+++ b/Plugins/PluginVcsSubversion.py	Sun Apr 04 13:57:59 2010 +0000
@@ -183,11 +183,10 @@
     
     def getPreferences(self, key):
         """
-        Public method to retrieve the various refactoring settings.
+        Public method to retrieve the various settings.
         
         @param key the key of the value to get
-        @param prefClass preferences class used as the storage area
-        @return the requested refactoring setting
+        @return the requested setting
         """
         if key in ["StopLogOnCopy"]:
             return Preferences.toBool(Preferences.Prefs.settings.value(
@@ -203,11 +202,10 @@
     
     def setPreferences(self, key, value):
         """
-        Public method to store the various refactoring settings.
+        Public method to store the various settings.
         
         @param key the key of the setting to be set
         @param value the value to be set
-        @param prefClass preferences class used as the storage area
         """
         Preferences.Prefs.settings.setValue("Subversion/" + key, value)
     
--- a/Plugins/VcsPlugins/vcsPySvn/SvnDialog.py	Fri Apr 02 17:12:47 2010 +0000
+++ b/Plugins/VcsPlugins/vcsPySvn/SvnDialog.py	Sun Apr 04 13:57:59 2010 +0000
@@ -138,5 +138,7 @@
     def hasAddOrDelete(self):
         """
         Public method to check, if the last action contained an add or delete.
+        
+        @return flag indicating the presence of an add or delete (boolean)
         """
         return self.__hasAddOrDelete
--- a/Plugins/VcsPlugins/vcsPySvn/subversion.py	Fri Apr 02 17:12:47 2010 +0000
+++ b/Plugins/VcsPlugins/vcsPySvn/subversion.py	Sun Apr 04 13:57:59 2010 +0000
@@ -791,6 +791,7 @@
         rx_prot = QRegExp('(file:|svn:|svn+ssh:|http:|https:).+')
         opts = self.options['global']
         res = False
+        
         if noDialog:
             if target is None:
                 return False
@@ -802,6 +803,11 @@
             if accepted:
                 target, force = dlg.getData()
         
+        if not rx_prot.exactMatch(target):
+            isDir = os.path.isdir(name)
+        else:
+            isDir = False
+        
         if accepted:
             client = self.getClient()
             if rx_prot.exactMatch(target):
@@ -834,12 +840,12 @@
                 dlg.exec_()
             if res and not rx_prot.exactMatch(target):
                 if target.startswith(project.getProjectPath()):
-                    if os.path.isdir(name):
+                    if isDir:
                         project.moveDirectory(name, target)
                     else:
                         project.renameFileInPdata(name, target)
                 else:
-                    if os.path.isdir(name):
+                    if isDir:
                         project.removeDirectory(name)
                     else:
                         project.removeFile(name)
--- a/Plugins/VcsPlugins/vcsSubversion/SvnDialog.py	Fri Apr 02 17:12:47 2010 +0000
+++ b/Plugins/VcsPlugins/vcsSubversion/SvnDialog.py	Sun Apr 04 13:57:59 2010 +0000
@@ -236,5 +236,7 @@
     def hasAddOrDelete(self):
         """
         Public method to check, if the last action contained an add or delete.
+        
+        @return flag indicating the presence of an add or delete (boolean)
         """
         return self.__hasAddOrDelete
--- a/Plugins/VcsPlugins/vcsSubversion/subversion.py	Fri Apr 02 17:12:47 2010 +0000
+++ b/Plugins/VcsPlugins/vcsSubversion/subversion.py	Sun Apr 04 13:57:59 2010 +0000
@@ -254,7 +254,7 @@
         @param projectDir project directory (string)
         @param noDialog flag indicating quiet operations
         @return flag indicating an execution without errors (boolean)
-            and a flag indicating the version controll status (boolean)
+            and a flag indicating the version control status (boolean)
         """
         noDialog = False
         msg = vcsDataDict["message"]
@@ -705,6 +705,11 @@
             if accepted:
                 target, force = dlg.getData()
         
+        if not rx_prot.exactMatch(target):
+            isDir = os.path.isdir(name)
+        else:
+            isDir = False
+        
         if accepted:
             args = []
             args.append('move')
@@ -729,12 +734,12 @@
                     res = dia.normalExit()
             if res and not rx_prot.exactMatch(target):
                 if target.startswith(project.getProjectPath()):
-                    if os.path.isdir(name):
+                    if isDir:
                         project.moveDirectory(name, target)
                     else:
                         project.renameFileInPdata(name, target)
                 else:
-                    if os.path.isdir(name):
+                    if isDir:
                         project.removeDirectory(name)
                     else:
                         project.removeFile(name)
@@ -1044,7 +1049,7 @@
         
         <b>Note:</b> If a shortcut is to be taken, the code will only check, if the named
         directory has been scanned already. If so, it is assumed, that the states for
-        all files has been populated by the previous run.
+        all files have been populated by the previous run.
         
         @param names dictionary with all filenames to be checked as keys
         @param dname directory to check in (string)
--- a/Project/ProjectBrowserModel.py	Fri Apr 02 17:12:47 2010 +0000
+++ b/Project/ProjectBrowserModel.py	Sun Apr 04 13:57:59 2010 +0000
@@ -128,6 +128,16 @@
         else:
             self.icon = UI.PixmapCache.getIcon("dirClosed.png")
     
+    def setName(self, dinfo, full = True):
+        """
+        Public method to set the directory name.
+        
+        @param dinfo dinfo is the string for the directory (string)
+        @param full flag indicating full pathname should be displayed (boolean)
+        """
+        self._dirName = os.path.abspath(dinfo)
+        self.itemData[0] = os.path.basename(self._dirName)
+    
     def dirName(self):
         """
         Public method returning the directory name.
@@ -653,19 +663,20 @@
         if itm is None:
             return
         
-        if itm.isLazyPopulated() and not itm.isPopulated():
-            # item is not populated yet, nothing to do
-            return
-        
-        if itm.childCount():
-            index = self.createIndex(itm.row(), 0, itm)
-            self.beginRemoveRows(index, 0, itm.childCount() - 1)
-            itm.removeChildren()
-            self.endRemoveRows()
-            Utilities.ModuleParser.resetParsedModule(\
-                os.path.join(self.project.ppath, name))
+        if itm.isLazyPopulated():
+            if not itm.isPopulated():
+                # item is not populated yet, nothing to do
+                return
             
-            self.populateItem(itm, True)
+            if itm.childCount():
+                index = self.createIndex(itm.row(), 0, itm)
+                self.beginRemoveRows(index, 0, itm.childCount() - 1)
+                itm.removeChildren()
+                self.endRemoveRows()
+                Utilities.ModuleParser.resetParsedModule(\
+                    os.path.join(self.project.ppath, name))
+                
+                self.populateItem(itm, True)
     
     def projectPropertiesChanged(self):
         """

eric ide

mercurial