def patch(self, review_request_id, squash=False): """Patch a single review request's diff using rbt patch. Args: review_request_id (int): The ID of the review request to patch. squash (bool, optional): Whether to squash multiple commits into a single commit. Raises: rbtools.commands.CommandError: There was an error applying the patch. """ patch_command = [RB_MAIN, 'patch'] patch_command.extend(build_rbtools_cmd_argv(self.options)) if self.options.edit: patch_command.append('-c') else: patch_command.append('-C') if squash: patch_command.append('--squash') patch_command.append(six.text_type(review_request_id)) rc, output = execute(patch_command, ignore_errors=True, return_error_code=True) if rc: raise CommandError('Failed to execute "rbt patch":\n%s' % output)
def patch(self, review_request_id): patch_command = [RB_MAIN, 'patch'] patch_command.extend(build_rbtools_cmd_argv(self.options)) if self.options.edit: patch_command.append('-c') else: patch_command.append('-C') patch_command.append(review_request_id) p = subprocess.Popen(patch_command) rc = p.wait() if rc: die('Failed to execute command: %s' % patch_command)
def patch(self, review_request_id): patch_command = [RB_MAIN, 'patch'] patch_command.extend(build_rbtools_cmd_argv(self.options)) if self.options.edit: patch_command.append('-c') else: patch_command.append('-C') patch_command.append(review_request_id) p = subprocess.Popen(patch_command) rc = p.wait() if rc: die('Failed to execute command: %s' % patch_command)
def patch(self, review_request_id): """Patch a single review request's diff using rbt patch.""" patch_command = [RB_MAIN, 'patch'] patch_command.extend(build_rbtools_cmd_argv(self.options)) if self.options.edit: patch_command.append('-c') else: patch_command.append('-C') patch_command.append(six.text_type(review_request_id)) rc, output = execute(patch_command, return_error_code=True) if rc: raise CommandError('Failed to execute "rbt patch":\n%s' % output)
def patch(self, review_request_id): """Patch a single review request's diff using rbt patch.""" patch_command = [RB_MAIN, 'patch'] patch_command.extend(build_rbtools_cmd_argv(self.options)) if self.options.edit: patch_command.append('-c') else: patch_command.append('-C') patch_command.append(six.text_type(review_request_id)) rc, output = execute(patch_command, ignore_errors=True, return_error_code=True) if rc: raise CommandError('Failed to execute "rbt patch":\n%s' % output)
def patch(self, review_request_id): patch_command = [RB_MAIN, 'patch'] patch_command.extend(build_rbtools_cmd_argv(self.options)) patch_command.append('-C') patch_command.append(review_request_id) print(execute(patch_command))