| 35 | |
| 36 | |
| 37 | def run_opts( |
| 38 | all_files=False, |
| 39 | files=(), |
| 40 | color=False, |
| 41 | verbose=False, |
| 42 | hook=None, |
| 43 | fail_fast=False, |
| 44 | remote_branch='', |
| 45 | local_branch='', |
| 46 | from_ref='', |
| 47 | to_ref='', |
| 48 | pre_rebase_upstream='', |
| 49 | pre_rebase_branch='', |
| 50 | remote_name='', |
| 51 | remote_url='', |
| 52 | hook_stage='pre-commit', |
| 53 | show_diff_on_failure=False, |
| 54 | commit_msg_filename='', |
| 55 | prepare_commit_message_source='', |
| 56 | commit_object_name='', |
| 57 | checkout_type='', |
| 58 | is_squash_merge='', |
| 59 | rewrite_command='', |
| 60 | ): |
| 61 | # These are mutually exclusive |
| 62 | assert not (all_files and files) |
| 63 | return auto_namedtuple( |
| 64 | all_files=all_files, |
| 65 | files=files, |
| 66 | color=color, |
| 67 | verbose=verbose, |
| 68 | hook=hook, |
| 69 | fail_fast=fail_fast, |
| 70 | remote_branch=remote_branch, |
| 71 | local_branch=local_branch, |
| 72 | from_ref=from_ref, |
| 73 | to_ref=to_ref, |
| 74 | pre_rebase_upstream=pre_rebase_upstream, |
| 75 | pre_rebase_branch=pre_rebase_branch, |
| 76 | remote_name=remote_name, |
| 77 | remote_url=remote_url, |
| 78 | hook_stage=hook_stage, |
| 79 | show_diff_on_failure=show_diff_on_failure, |
| 80 | commit_msg_filename=commit_msg_filename, |
| 81 | prepare_commit_message_source=prepare_commit_message_source, |
| 82 | commit_object_name=commit_object_name, |
| 83 | checkout_type=checkout_type, |
| 84 | is_squash_merge=is_squash_merge, |
| 85 | rewrite_command=rewrite_command, |
| 86 | ) |
| 87 | |
| 88 | |
| 89 | @contextlib.contextmanager |