diff options
| author | Daniel Sandler <dsandler@android.com> | 2012-04-06 10:39:32 -0400 |
|---|---|---|
| committer | Daniel Sandler <dsandler@android.com> | 2012-04-06 10:43:36 -0400 |
| commit | e9d6b611c5bec499360c175035770132f1e60c71 (patch) | |
| tree | f20482b6545d436d9be3204e5e2d3afdddc2ccd5 | |
| parent | c3d2f2b76f1f34703106031bdbcb6c34df81686c (diff) | |
| download | git-repo-e9d6b611c5bec499360c175035770132f1e60c71.tar.gz | |
New flag for repo upload: --current_branch (--cbr)
A convenient equivalent to `repo upload --br=<current git branch>`.
Note that the head branch will be selected for each project
uploaded by repo, so different branches may be uploaded for
different projects.
Change-Id: I10ad8ceaa63f055105c2d847c6e329fa4226dbaf
| -rw-r--r-- | subcmds/upload.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py index 53118f6b..07bd4d81 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
| @@ -123,6 +123,9 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
| 123 | p.add_option('--br', | 123 | p.add_option('--br', |
| 124 | type='string', action='store', dest='branch', | 124 | type='string', action='store', dest='branch', |
| 125 | help='Branch to upload.') | 125 | help='Branch to upload.') |
| 126 | p.add_option('--cbr', '--current-branch', | ||
| 127 | dest='current_branch', action='store_true', | ||
| 128 | help='Upload current git branch.') | ||
| 126 | 129 | ||
| 127 | # Options relating to upload hook. Note that verify and no-verify are NOT | 130 | # Options relating to upload hook. Note that verify and no-verify are NOT |
| 128 | # opposites of each other, which is why they store to different locations. | 131 | # opposites of each other, which is why they store to different locations. |
| @@ -351,7 +354,11 @@ Gerrit Code Review: http://code.google.com/p/gerrit/ | |||
| 351 | branch = opt.branch | 354 | branch = opt.branch |
| 352 | 355 | ||
| 353 | for project in project_list: | 356 | for project in project_list: |
| 354 | avail = project.GetUploadableBranches(branch) | 357 | if opt.current_branch: |
| 358 | cbr = project.CurrentBranch | ||
| 359 | avail = [project.GetUploadableBranch(cbr)] if cbr else None | ||
| 360 | else: | ||
| 361 | avail = project.GetUploadableBranches(branch) | ||
| 355 | if avail: | 362 | if avail: |
| 356 | pending.append((project, avail)) | 363 | pending.append((project, avail)) |
| 357 | 364 | ||
