37 |
37 |
38 self.__ioEncoding = Preferences.getSystem("IOEncoding") |
38 self.__ioEncoding = Preferences.getSystem("IOEncoding") |
39 |
39 |
40 self.rx_status1 = \ |
40 self.rx_status1 = \ |
41 QRegExp('(.{8,9})\\s+([0-9-]+)\\s+(.+)\\s*') |
41 QRegExp('(.{8,9})\\s+([0-9-]+)\\s+(.+)\\s*') |
42 self.rx_status2 = \ |
42 self.rx_status2 = QRegExp( |
43 QRegExp('(.{8,9})\\s+([0-9-]+)\\s+([0-9?]+)\\s+([\\w?]+)\\s+(.+)\\s*') |
43 '(.{8,9})\\s+([0-9-]+)\\s+([0-9?]+)\\s+([\\w?]+)\\s+(.+)\\s*') |
44 |
44 |
45 def _performMonitor(self): |
45 def _performMonitor(self): |
46 """ |
46 """ |
47 Protected method implementing the monitoring action. |
47 Protected method implementing the monitoring action. |
48 |
48 |
76 process.start('svn', args) |
76 process.start('svn', args) |
77 procStarted = process.waitForStarted(5000) |
77 procStarted = process.waitForStarted(5000) |
78 if procStarted: |
78 if procStarted: |
79 finished = process.waitForFinished(300000) |
79 finished = process.waitForFinished(300000) |
80 if finished and process.exitCode() == 0: |
80 if finished and process.exitCode() == 0: |
81 output = \ |
81 output = str(process.readAllStandardOutput(), |
82 str(process.readAllStandardOutput(), self.__ioEncoding, 'replace') |
82 self.__ioEncoding, 'replace') |
83 states = {} |
83 states = {} |
84 for line in output.splitlines(): |
84 for line in output.splitlines(): |
85 if self.rx_status1.exactMatch(line): |
85 if self.rx_status1.exactMatch(line): |
86 flags = self.rx_status1.cap(1) |
86 flags = self.rx_status1.cap(1) |
87 path = self.rx_status1.cap(3).strip() |
87 path = self.rx_status1.cap(3).strip() |
104 self.shouldUpdate = True |
104 self.shouldUpdate = True |
105 name = path |
105 name = path |
106 states[name] = status |
106 states[name] = status |
107 try: |
107 try: |
108 if self.reportedStates[name] != status: |
108 if self.reportedStates[name] != status: |
109 self.statusList.append("{0} {1}".format(status, name)) |
109 self.statusList.append( |
|
110 "{0} {1}".format(status, name)) |
110 except KeyError: |
111 except KeyError: |
111 self.statusList.append("{0} {1}".format(status, name)) |
112 self.statusList.append( |
|
113 "{0} {1}".format(status, name)) |
112 for name in list(self.reportedStates.keys()): |
114 for name in list(self.reportedStates.keys()): |
113 if name not in states: |
115 if name not in states: |
114 self.statusList.append(" {0}".format(name)) |
116 self.statusList.append(" {0}".format(name)) |
115 self.reportedStates = states |
117 self.reportedStates = states |
116 return True, \ |
118 return True, self.trUtf8( |
117 self.trUtf8("Subversion status checked successfully (using svn)") |
119 "Subversion status checked successfully (using svn)") |
118 else: |
120 else: |
119 process.kill() |
121 process.kill() |
120 process.waitForFinished() |
122 process.waitForFinished() |
121 return False, \ |
123 return False, \ |
122 str(process.readAllStandardError(), |
124 str(process.readAllStandardError(), |
123 Preferences.getSystem("IOEncoding"), |
125 Preferences.getSystem("IOEncoding"), |
124 'replace') |
126 'replace') |
125 else: |
127 else: |
126 process.kill() |
128 process.kill() |
127 process.waitForFinished() |
129 process.waitForFinished() |
128 return False, self.trUtf8("Could not start the Subversion process.") |
130 return False, self.trUtf8( |
|
131 "Could not start the Subversion process.") |