diff options
| -rw-r--r-- | subcmds/rebase.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/subcmds/rebase.py b/subcmds/rebase.py index 9bc4460c..346eb9cd 100644 --- a/subcmds/rebase.py +++ b/subcmds/rebase.py | |||
| @@ -37,6 +37,9 @@ branch but need to incorporate new upstream changes "underneath" them. | |||
| 37 | dest="interactive", action="store_true", | 37 | dest="interactive", action="store_true", |
| 38 | help="interactive rebase (single project only)") | 38 | help="interactive rebase (single project only)") |
| 39 | 39 | ||
| 40 | p.add_option('--fail-fast', | ||
| 41 | dest='fail_fast', action='store_true', | ||
| 42 | help='Stop rebasing after first error is hit') | ||
| 40 | p.add_option('-f', '--force-rebase', | 43 | p.add_option('-f', '--force-rebase', |
| 41 | dest='force_rebase', action='store_true', | 44 | dest='force_rebase', action='store_true', |
| 42 | help='Pass --force-rebase to git rebase') | 45 | help='Pass --force-rebase to git rebase') |
| @@ -88,7 +91,11 @@ branch but need to incorporate new upstream changes "underneath" them. | |||
| 88 | if opt.interactive: | 91 | if opt.interactive: |
| 89 | common_args.append('-i') | 92 | common_args.append('-i') |
| 90 | 93 | ||
| 94 | ret = 0 | ||
| 91 | for project in all_projects: | 95 | for project in all_projects: |
| 96 | if ret and opt.fail_fast: | ||
| 97 | break | ||
| 98 | |||
| 92 | cb = project.CurrentBranch | 99 | cb = project.CurrentBranch |
| 93 | if not cb: | 100 | if not cb: |
| 94 | if one_project: | 101 | if one_project: |
| @@ -127,13 +134,19 @@ branch but need to incorporate new upstream changes "underneath" them. | |||
| 127 | stash_args = ["stash"] | 134 | stash_args = ["stash"] |
| 128 | 135 | ||
| 129 | if GitCommand(project, stash_args).Wait() != 0: | 136 | if GitCommand(project, stash_args).Wait() != 0: |
| 130 | return 1 | 137 | ret += 1 |
| 138 | continue | ||
| 131 | 139 | ||
| 132 | if GitCommand(project, args).Wait() != 0: | 140 | if GitCommand(project, args).Wait() != 0: |
| 133 | return 1 | 141 | ret += 1 |
| 142 | continue | ||
| 134 | 143 | ||
| 135 | if needs_stash: | 144 | if needs_stash: |
| 136 | stash_args.append('pop') | 145 | stash_args.append('pop') |
| 137 | stash_args.append('--quiet') | 146 | stash_args.append('--quiet') |
| 138 | if GitCommand(project, stash_args).Wait() != 0: | 147 | if GitCommand(project, stash_args).Wait() != 0: |
| 139 | return 1 | 148 | ret += 1 |
| 149 | |||
| 150 | if ret: | ||
| 151 | print('error: %i projects had errors' % (ret,), file=sys.stderr) | ||
| 152 | return ret | ||
