31 |
31 |
32 self.__ioEncoding = Preferences.getSystem("IOEncoding") |
32 self.__ioEncoding = Preferences.getSystem("IOEncoding") |
33 |
33 |
34 self.rx_status1 = \ |
34 self.rx_status1 = \ |
35 QRegExp('(.{8,9})\\s+([0-9-]+)\\s+(.+)\\s*') |
35 QRegExp('(.{8,9})\\s+([0-9-]+)\\s+(.+)\\s*') |
36 self.rx_status2 = \ |
36 self.rx_status2 = QRegExp( |
37 QRegExp('(.{8,9})\\s+([0-9-]+)\\s+([0-9?]+)\\s+([\\w?]+)\\s+(.+)\\s*') |
37 '(.{8,9})\\s+([0-9-]+)\\s+([0-9?]+)\\s+([\\w?]+)\\s+(.+)\\s*') |
38 |
38 |
39 def _performMonitor(self): |
39 def _performMonitor(self): |
40 """ |
40 """ |
41 Protected method implementing the monitoring action. |
41 Protected method implementing the monitoring action. |
42 |
42 |
70 process.start('svn', args) |
70 process.start('svn', args) |
71 procStarted = process.waitForStarted(5000) |
71 procStarted = process.waitForStarted(5000) |
72 if procStarted: |
72 if procStarted: |
73 finished = process.waitForFinished(300000) |
73 finished = process.waitForFinished(300000) |
74 if finished and process.exitCode() == 0: |
74 if finished and process.exitCode() == 0: |
75 output = \ |
75 output = str(process.readAllStandardOutput(), |
76 str(process.readAllStandardOutput(), self.__ioEncoding, 'replace') |
76 self.__ioEncoding, 'replace') |
77 states = {} |
77 states = {} |
78 for line in output.splitlines(): |
78 for line in output.splitlines(): |
79 if self.rx_status1.exactMatch(line): |
79 if self.rx_status1.exactMatch(line): |
80 flags = self.rx_status1.cap(1) |
80 flags = self.rx_status1.cap(1) |
81 path = self.rx_status1.cap(3).strip() |
81 path = self.rx_status1.cap(3).strip() |
98 self.shouldUpdate = True |
98 self.shouldUpdate = True |
99 name = path |
99 name = path |
100 states[name] = status |
100 states[name] = status |
101 try: |
101 try: |
102 if self.reportedStates[name] != status: |
102 if self.reportedStates[name] != status: |
103 self.statusList.append("{0} {1}".format(status, name)) |
103 self.statusList.append( |
|
104 "{0} {1}".format(status, name)) |
104 except KeyError: |
105 except KeyError: |
105 self.statusList.append("{0} {1}".format(status, name)) |
106 self.statusList.append( |
|
107 "{0} {1}".format(status, name)) |
106 for name in list(self.reportedStates.keys()): |
108 for name in list(self.reportedStates.keys()): |
107 if name not in states: |
109 if name not in states: |
108 self.statusList.append(" {0}".format(name)) |
110 self.statusList.append(" {0}".format(name)) |
109 self.reportedStates = states |
111 self.reportedStates = states |
110 return True, \ |
112 return True, self.trUtf8( |
111 self.trUtf8("Subversion status checked successfully (using svn)") |
113 "Subversion status checked successfully (using svn)") |
112 else: |
114 else: |
113 process.kill() |
115 process.kill() |
114 process.waitForFinished() |
116 process.waitForFinished() |
115 return False, \ |
117 return False, \ |
116 str(process.readAllStandardError(), |
118 str(process.readAllStandardError(), |
117 Preferences.getSystem("IOEncoding"), |
119 Preferences.getSystem("IOEncoding"), |
118 'replace') |
120 'replace') |
119 else: |
121 else: |
120 process.kill() |
122 process.kill() |
121 process.waitForFinished() |
123 process.waitForFinished() |
122 return False, self.trUtf8("Could not start the Subversion process.") |
124 return False, self.trUtf8( |
|
125 "Could not start the Subversion process.") |