eric6/Plugins/VcsPlugins/vcsSubversion/SvnStatusMonitorThread.py

changeset 7775
4a1db75550bd
parent 7360
9190402e4505
child 7923
91e843545d9a
--- a/eric6/Plugins/VcsPlugins/vcsSubversion/SvnStatusMonitorThread.py	Sat Oct 10 16:03:53 2020 +0200
+++ b/eric6/Plugins/VcsPlugins/vcsSubversion/SvnStatusMonitorThread.py	Sun Oct 11 17:54:52 2020 +0200
@@ -7,8 +7,9 @@
 Module implementing the VCS status monitor thread class for Subversion.
 """
 
+import re
 
-from PyQt5.QtCore import QRegExp, QProcess
+from PyQt5.QtCore import QProcess
 
 from VCS.StatusMonitorThread import VcsStatusMonitorThread
 
@@ -32,8 +33,8 @@
         
         self.__ioEncoding = Preferences.getSystem("IOEncoding")
         
-        self.rx_status1 = QRegExp('(.{8,9})\\s+([0-9-]+)\\s+(.+)\\s*')
-        self.rx_status2 = QRegExp(
+        self.rx_status1 = re.compile('(.{8,9})\\s+([0-9-]+)\\s+(.+)\\s*')
+        self.rx_status2 = re.compile(
             '(.{8,9})\\s+([0-9-]+)\\s+([0-9?]+)\\s+(\\S+)\\s+(.+)\\s*')
     
     def _performMonitor(self):
@@ -76,14 +77,18 @@
                              self.__ioEncoding, 'replace')
                 states = {}
                 for line in output.splitlines():
-                    if self.rx_status1.exactMatch(line):
-                        flags = self.rx_status1.cap(1)
-                        path = self.rx_status1.cap(3).strip()
-                    elif self.rx_status2.exactMatch(line):
-                        flags = self.rx_status2.cap(1)
-                        path = self.rx_status2.cap(5).strip()
-                    else:
+                    match = (
+                        self.rx_status1.fullmatch(line) or
+                        self.rx_status2.fullmatch(line)
+                    )
+                    if match is None:
                         continue
+                    elif match.re is self.rx_status1:
+                        flags = match.group(1)
+                        path = match.group(3).strip()
+                    elif match.re is self.rx_status2:
+                        flags = match.group(1)
+                        path = match.group(5).strip()
                     if (
                         flags[0] in "ACDMR" or
                         (flags[0] == " " and flags[-1] == "*")

eric ide

mercurial