26 @param project reference to the project object (Project) |
24 @param project reference to the project object (Project) |
27 @param vcs reference to the version control object |
25 @param vcs reference to the version control object |
28 @param parent reference to the parent object (QObject) |
26 @param parent reference to the parent object (QObject) |
29 """ |
27 """ |
30 VcsStatusMonitorThread.__init__(self, interval, project, vcs, parent) |
28 VcsStatusMonitorThread.__init__(self, interval, project, vcs, parent) |
31 |
|
32 self.__ioEncoding = Preferences.getSystem("IOEncoding") |
|
33 |
29 |
34 self.__client = None |
30 self.__client = None |
35 self.__useCommandLine = False |
31 self.__useCommandLine = False |
36 |
32 |
37 def _performMonitor(self): |
33 def _performMonitor(self): |
88 procStarted = process.waitForStarted(5000) |
83 procStarted = process.waitForStarted(5000) |
89 if procStarted: |
84 if procStarted: |
90 finished = process.waitForFinished(300000) |
85 finished = process.waitForFinished(300000) |
91 if finished and process.exitCode() == 0: |
86 if finished and process.exitCode() == 0: |
92 output = str(process.readAllStandardOutput(), |
87 output = str(process.readAllStandardOutput(), |
93 self.__ioEncoding, 'replace') |
88 self.vcs.getEncoding(), 'replace') |
94 else: |
89 else: |
95 process.kill() |
90 process.kill() |
96 process.waitForFinished() |
91 process.waitForFinished() |
97 error = str(process.readAllStandardError(), |
92 error = str(process.readAllStandardError(), |
98 self.__ioEncoding, 'replace') |
93 self.vcs.getEncoding(), 'replace') |
99 else: |
94 else: |
100 process.kill() |
95 process.kill() |
101 process.waitForFinished() |
96 process.waitForFinished() |
102 error = self.tr("Could not start the Mercurial process.") |
97 error = self.tr("Could not start the Mercurial process.") |
103 |
98 |
129 process.start('hg', args) |
123 process.start('hg', args) |
130 procStarted = process.waitForStarted(5000) |
124 procStarted = process.waitForStarted(5000) |
131 if procStarted: |
125 if procStarted: |
132 finished = process.waitForFinished(300000) |
126 finished = process.waitForFinished(300000) |
133 if finished and process.exitCode() == 0: |
127 if finished and process.exitCode() == 0: |
134 output = str( |
128 output = str(process.readAllStandardOutput(), |
135 process.readAllStandardOutput(), |
129 self.vcs.getEncoding(), 'replace') |
136 self.__ioEncoding, 'replace') |
|
137 |
130 |
138 for line in output.splitlines(): |
131 for line in output.splitlines(): |
139 flag, name = line.split(" ", 1) |
132 flag, name = line.split(" ", 1) |
140 if flag == "U": |
133 if flag == "U": |
141 states[name] = "Z" # conflict |
134 states[name] = "Z" # conflict |