summaryrefslogtreecommitdiffstats
path: root/subcmds/upload.py
diff options
context:
space:
mode:
authorMandeep Singh Baines <msb@google.com>2011-05-26 10:34:11 -0700
committerMandeep Singh Baines <msb@google.com>2011-05-26 10:49:39 -0700
commitd6c93a28ca8cb079f473f749d805dcff97990225 (patch)
tree21cd307899c2a5d1e59df9929d63651ac2ba1da1 /subcmds/upload.py
parentd572a13021b0430eddf83e9caedc9d5add693c62 (diff)
downloadgit-repo-d6c93a28ca8cb079f473f749d805dcff97990225.tar.gz
Add branch support to repo upload
This commit adds a --br=<branch> option to repo upload. repo currently examines every non-published branch. This is problematic for my workflow. I have many branches in my kernel tree. Many of these branches are based off of upstream remotes (I have many remotes) and will never be uploaded (they'll get sent upstream as a patch). Having repo scan these branches adds to my upload processing time and clutters the branch selection buffer. I've also seen repo get confused when one of my branches is 1000s of commits different from m/master. Change-Id: I68fa18951ea59ba373277b57ffcaf8cddd7e7a40
Diffstat (limited to 'subcmds/upload.py')
-rw-r--r--subcmds/upload.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/subcmds/upload.py b/subcmds/upload.py
index c561b8aa..c1958373 100644
--- a/subcmds/upload.py
+++ b/subcmds/upload.py
@@ -120,6 +120,9 @@ Gerrit Code Review: http://code.google.com/p/gerrit/
120 p.add_option('--cc', 120 p.add_option('--cc',
121 type='string', action='append', dest='cc', 121 type='string', action='append', dest='cc',
122 help='Also send email to these email addresses.') 122 help='Also send email to these email addresses.')
123 p.add_option('--br',
124 type='string', action='store', dest='branch',
125 help='Branch to upload.')
123 126
124 # Options relating to upload hook. Note that verify and no-verify are NOT 127 # Options relating to upload hook. Note that verify and no-verify are NOT
125 # opposites of each other, which is why they store to different locations. 128 # opposites of each other, which is why they store to different locations.
@@ -336,9 +339,13 @@ Gerrit Code Review: http://code.google.com/p/gerrit/
336 pending = [] 339 pending = []
337 reviewers = [] 340 reviewers = []
338 cc = [] 341 cc = []
342 branch = None
343
344 if opt.branch:
345 branch = opt.branch
339 346
340 for project in project_list: 347 for project in project_list:
341 avail = project.GetUploadableBranches() 348 avail = project.GetUploadableBranches(branch)
342 if avail: 349 if avail:
343 pending.append((project, avail)) 350 pending.append((project, avail))
344 351