Plugins/VcsPlugins/vcsGit/git.py

changeset 6508
51897256fc83
parent 6324
b11c36cba2a1
child 6645
ad476851d7e0
equal deleted inserted replaced
6507:54054456ca58 6508:51897256fc83
188 if procStarted: 188 if procStarted:
189 finished = process.waitForFinished(30000) 189 finished = process.waitForFinished(30000)
190 if finished and process.exitCode() == 0: 190 if finished and process.exitCode() == 0:
191 output = str(process.readAllStandardOutput(), 191 output = str(process.readAllStandardOutput(),
192 ioEncoding, 'replace') 192 ioEncoding, 'replace')
193 self.versionStr = output.splitlines()[0].split()[-1] 193 versionLine = output.splitlines()[0]
194 v = list(re.match(r'.*?(\d+)\.(\d+)\.?(\d+)?\.?(\d+)?', 194 v = list(re.match(r'.*?(\d+)\.(\d+)\.?(\d+)?\.?(\d+)?',
195 self.versionStr).groups()) 195 versionLine).groups())
196 for i in range(4): 196 for i in range(4):
197 try: 197 try:
198 v[i] = int(v[i]) 198 v[i] = int(v[i])
199 except TypeError: 199 except TypeError:
200 v[i] = 0 200 v[i] = 0
201 except IndexError: 201 except IndexError:
202 v.append(0) 202 v.append(0)
203 self.version = tuple(v) 203 self.version = tuple(v)
204 self.versionStr = '.'.join([str(v) for v in self.version])
204 return True, errMsg 205 return True, errMsg
205 else: 206 else:
206 if finished: 207 if finished:
207 errMsg = self.tr( 208 errMsg = self.tr(
208 "The git process finished with the exit code {0}")\ 209 "The git process finished with the exit code {0}")\

eric ide

mercurial