def review_patch(self, patch): task = EarlyWarningSystemTask(self, patch, self._options.run_tests) if not task.validate(): self._did_error(patch, "%s did not process patch." % self.name) return False try: return task.run() except UnableToApplyPatch, e: self._did_error(patch, "%s unable to apply patch." % self.name) return False
def review_patch(self, patch): task = EarlyWarningSystemTask(self, patch, self._options.run_tests) try: succeeded = task.run() if not succeeded: # Caller unlocks when review_patch returns True, so we only need to unlock on transient failure. self._unlock_patch(patch) return succeeded except PatchIsNotValid as error: self._did_error(patch, "%s did not process patch. Reason: %s" % (self.name, error.failure_message)) return False except UnableToApplyPatch, e: self._did_error(patch, "%s unable to apply patch." % self.name) return False
def review_patch(self, patch): task = EarlyWarningSystemTask(self, patch, self._options.run_tests) try: succeeded = task.run() if not succeeded: # Caller unlocks when review_patch returns True, so we only need to unlock on transient failure. self._unlock_patch(patch) return succeeded except PatchIsNotValid: self._did_error(patch, "%s did not process patch." % self.name) return False except UnableToApplyPatch, e: self._did_error(patch, "%s unable to apply patch." % self.name) return False