mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
rebase: pull out project-independent settings from the for loop
This makes the code a bit easier to read by doing all the project independent settings first instead of repeating it for every for loop iteration. Change-Id: I4ff21296e444627beba2f4b86561069f5e9a0d73 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/233554 Reviewed-by: David Pursehouse <dpursehouse@collab.net> Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
parent
a850ca2712
commit
d5c306b404
@ -73,6 +73,21 @@ branch but need to incorporate new upstream changes "underneath" them.
|
|||||||
file=sys.stderr)
|
file=sys.stderr)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
# Setup the common git rebase args that we use for all projects.
|
||||||
|
common_args = ['rebase']
|
||||||
|
if opt.whitespace:
|
||||||
|
common_args.append('--whitespace=%s' % opt.whitespace)
|
||||||
|
if opt.quiet:
|
||||||
|
common_args.append('--quiet')
|
||||||
|
if opt.force_rebase:
|
||||||
|
common_args.append('--force-rebase')
|
||||||
|
if opt.no_ff:
|
||||||
|
common_args.append('--no-ff')
|
||||||
|
if opt.autosquash:
|
||||||
|
common_args.append('--autosquash')
|
||||||
|
if opt.interactive:
|
||||||
|
common_args.append('-i')
|
||||||
|
|
||||||
for project in all_projects:
|
for project in all_projects:
|
||||||
cb = project.CurrentBranch
|
cb = project.CurrentBranch
|
||||||
if not cb:
|
if not cb:
|
||||||
@ -92,26 +107,7 @@ branch but need to incorporate new upstream changes "underneath" them.
|
|||||||
# ignore branches without remotes
|
# ignore branches without remotes
|
||||||
continue
|
continue
|
||||||
|
|
||||||
args = ["rebase"]
|
args = common_args[:]
|
||||||
|
|
||||||
if opt.whitespace:
|
|
||||||
args.append('--whitespace=%s' % opt.whitespace)
|
|
||||||
|
|
||||||
if opt.quiet:
|
|
||||||
args.append('--quiet')
|
|
||||||
|
|
||||||
if opt.force_rebase:
|
|
||||||
args.append('--force-rebase')
|
|
||||||
|
|
||||||
if opt.no_ff:
|
|
||||||
args.append('--no-ff')
|
|
||||||
|
|
||||||
if opt.autosquash:
|
|
||||||
args.append('--autosquash')
|
|
||||||
|
|
||||||
if opt.interactive:
|
|
||||||
args.append("-i")
|
|
||||||
|
|
||||||
if opt.onto_manifest:
|
if opt.onto_manifest:
|
||||||
args.append('--onto')
|
args.append('--onto')
|
||||||
args.append(project.revisionExpr)
|
args.append(project.revisionExpr)
|
||||||
|
Loading…
Reference in New Issue
Block a user