Fixed a bug causing some false VCS status being shown in the project browser. eric7

Wed, 24 Nov 2021 20:06:52 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 24 Nov 2021 20:06:52 +0100
branch
eric7
changeset 8787
779054e59d8e
parent 8785
1d5e14d8cdd5
child 8789
b165effc3c62

Fixed a bug causing some false VCS status being shown in the project browser.

eric7/Project/ProjectBrowserModel.py file | annotate | diff | comparison | revisions
diff -r 1d5e14d8cdd5 -r 779054e59d8e eric7/Project/ProjectBrowserModel.py
--- a/eric7/Project/ProjectBrowserModel.py	Wed Nov 24 17:11:08 2021 +0100
+++ b/eric7/Project/ProjectBrowserModel.py	Wed Nov 24 20:06:52 2021 +0100
@@ -894,32 +894,33 @@
         
         for name in statesList:
             state = name[0]
-            name = name[1:].strip()
-            if state == ' ':
-                if name in self.__vcsStatus:
-                    del self.__vcsStatus[name]
-            else:
-                self.__vcsStatus[name] = state
-            
-            try:
-                itm = itemCache[name]
-            except KeyError:
-                itm = self.findItem(name)
+            if state in "AMORUZ ":
+                name = name[1:].strip()
+                if state == ' ':
+                    if name in self.__vcsStatus:
+                        del self.__vcsStatus[name]
+                else:
+                    self.__vcsStatus[name] = state
+                
+                try:
+                    itm = itemCache[name]
+                except KeyError:
+                    itm = self.findItem(name)
+                    if itm:
+                        itemCache[name] = itm
                 if itm:
-                    itemCache[name] = itm
-            if itm:
-                itm.setVcsState(state)
-                itm.setVcsStatus(self.project.vcs.vcsName())
-                index1 = self.createIndex(itm.row(), 0, itm)
-                index2 = self.createIndex(
-                    itm.row(), self.rootItem.columnCount(), itm)
-                self.dataChanged.emit(index1, index2)
-            
-            head, tail = os.path.split(name)
-            if head != lastHead:
-                if lastHead:
-                    self.__changeParentsVCSState(lastHead, itemCache)
-                lastHead = head
+                    itm.setVcsState(state)
+                    itm.setVcsStatus(self.project.vcs.vcsName())
+                    index1 = self.createIndex(itm.row(), 0, itm)
+                    index2 = self.createIndex(
+                        itm.row(), self.rootItem.columnCount(), itm)
+                    self.dataChanged.emit(index1, index2)
+                
+                head, tail = os.path.split(name)
+                if head != lastHead:
+                    if lastHead:
+                        self.__changeParentsVCSState(lastHead, itemCache)
+                    lastHead = head
         if lastHead:
             self.__changeParentsVCSState(lastHead, itemCache)
         try:

eric ide

mercurial