if changeInfo is None:
changeInfo = self.gerrit.getChangeInfo(nativeSampleChange)
- if changeInfo['status'] != "MERGED" and changeInfo['status'] != "ABANDONED":
- os.chdir(nativeSampleChange.nativeSample.projectPath)
- self._cleanRepoAndCheckoutToRevision(sampleChange = nativeSampleChange)
- sourceType = self._currentSourceType()
- if sourceType == self.SourceTypeTpkProject:
- tempTccOutputDir = tempfile.mkdtemp()
- self.invokeConvert(revision = nativeSampleChange.revisionId, outputDirectory = tempTccOutputDir)
- os.chdir(tempTccOutputDir)
- elif sourceType != self.SourceTypeSampleProject:
- raise ValueError("Wrong source type to use tcc tool")
- result, tccOutput = self.invokeTcc()
- print tccOutput
- if not result:
- print 'FAIL: tcc for ', nativeSampleChange.nativeSample.projectName, ' and changeId:', nativeSampleChange.changeId
- return False, tccOutput
- else:
- print "change already " + changeInfo['status']
+ os.chdir(nativeSampleChange.nativeSample.projectPath)
+ self._cleanRepoAndCheckoutToRevision(sampleChange = nativeSampleChange)
+ sourceType = self._currentSourceType()
+ if sourceType == self.SourceTypeTpkProject:
+ tempTccOutputDir = tempfile.mkdtemp()
+ self.invokeConvert(revision = nativeSampleChange.revisionId, outputDirectory = tempTccOutputDir)
+ os.chdir(tempTccOutputDir)
+ elif sourceType != self.SourceTypeSampleProject:
+ raise ValueError("Wrong source type to use tcc tool")
+ result, tccOutput = self.invokeTcc()
+ print tccOutput
+ if not result:
+ print 'FAIL: tcc for ', nativeSampleChange.nativeSample.projectName, ' and changeId:', nativeSampleChange.changeId
+ return False, tccOutput
finally:
self._cleanRepoAndCheckoutToRevision(sampleChange = nativeSampleChange)
os.chdir(curDir)
if changeInfo is None:
changeInfo = self.gerrit.getChangeInfo(nativeSampleChange)
- if changeInfo['status'] != "MERGED" and changeInfo['status'] != "ABANDONED":
- os.chdir(nativeSampleChange.nativeSample.projectPath)
- self._cleanRepoAndCheckoutToRevision(sampleChange = nativeSampleChange)
- res, output = self.invokeCheckpatchTizen()
- if res:
- print output
- print "SUCCESS: sources checked with checkpatch_tizen.pl for " + nativeSampleChange.changeId + " from project " + nativeSampleChange.nativeSample.projectName
- else:
- print "ERROR:", output
- print "FAIL: sources checked failed with checkpatch_tizen.pl for " + nativeSampleChange.changeId + " from project " + nativeSampleChange.nativeSample.projectName
- return False, output
+ os.chdir(nativeSampleChange.nativeSample.projectPath)
+ self._cleanRepoAndCheckoutToRevision(sampleChange = nativeSampleChange)
+ res, output = self.invokeCheckpatchTizen()
+ if res:
+ print output
+ print "SUCCESS: sources checked with checkpatch_tizen.pl for " + nativeSampleChange.changeId + " from project " + nativeSampleChange.nativeSample.projectName
else:
- print "change already " + changeInfo['status']
+ print "ERROR:", output
+ print "FAIL: sources checked failed with checkpatch_tizen.pl for " + nativeSampleChange.changeId + " from project " + nativeSampleChange.nativeSample.projectName
+ return False, output
finally:
os.chdir(curDir)
return True, ""