93 process.start('hg', args) |
93 process.start('hg', args) |
94 procStarted = process.waitForStarted(5000) |
94 procStarted = process.waitForStarted(5000) |
95 if procStarted: |
95 if procStarted: |
96 finished = process.waitForFinished(300000) |
96 finished = process.waitForFinished(300000) |
97 if finished and process.exitCode() == 0: |
97 if finished and process.exitCode() == 0: |
98 output = \ |
98 output = str(process.readAllStandardOutput(), |
99 str(process.readAllStandardOutput(), self.__ioEncoding, 'replace') |
99 self.__ioEncoding, 'replace') |
100 else: |
100 else: |
101 process.kill() |
101 process.kill() |
102 process.waitForFinished() |
102 process.waitForFinished() |
103 error = \ |
103 error = str(process.readAllStandardError(), |
104 str(process.readAllStandardError(), self.__ioEncoding, 'replace') |
104 self.__ioEncoding, 'replace') |
105 else: |
105 else: |
106 process.kill() |
106 process.kill() |
107 process.waitForFinished() |
107 process.waitForFinished() |
108 error = self.trUtf8("Could not start the Mercurial process.") |
108 error = self.trUtf8("Could not start the Mercurial process.") |
109 |
109 |
136 procStarted = process.waitForStarted(5000) |
136 procStarted = process.waitForStarted(5000) |
137 if procStarted: |
137 if procStarted: |
138 finished = process.waitForFinished(300000) |
138 finished = process.waitForFinished(300000) |
139 if finished and process.exitCode() == 0: |
139 if finished and process.exitCode() == 0: |
140 output = str( |
140 output = str( |
141 process.readAllStandardOutput(), self.__ioEncoding, 'replace') |
141 process.readAllStandardOutput(), |
|
142 self.__ioEncoding, 'replace') |
142 |
143 |
143 for line in output.splitlines(): |
144 for line in output.splitlines(): |
144 flag, name = line.split(" ", 1) |
145 flag, name = line.split(" ", 1) |
145 if flag == "U": |
146 if flag == "U": |
146 states[name] = "Z" # conflict |
147 states[name] = "Z" # conflict |
147 |
148 |
148 # step 3: collect the status to be reported back |
149 # step 3: collect the status to be reported back |
149 for name in states: |
150 for name in states: |
150 try: |
151 try: |
151 if self.reportedStates[name] != states[name]: |
152 if self.reportedStates[name] != states[name]: |
152 self.statusList.append("{0} {1}".format(states[name], name)) |
153 self.statusList.append( |
|
154 "{0} {1}".format(states[name], name)) |
153 except KeyError: |
155 except KeyError: |
154 self.statusList.append("{0} {1}".format(states[name], name)) |
156 self.statusList.append("{0} {1}".format(states[name], name)) |
155 for name in self.reportedStates.keys(): |
157 for name in self.reportedStates.keys(): |
156 if name not in states: |
158 if name not in states: |
157 self.statusList.append(" {0}".format(name)) |
159 self.statusList.append(" {0}".format(name)) |