summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--project.py4
-rw-r--r--subcmds/upload.py9
2 files changed, 11 insertions, 2 deletions
diff --git a/project.py b/project.py
index 6252bd68..e5dbf25e 100644
--- a/project.py
+++ b/project.py
@@ -791,7 +791,7 @@ class Project(object):
791 if R_HEADS + n not in heads: 791 if R_HEADS + n not in heads:
792 self.bare_git.DeleteRef(name, id) 792 self.bare_git.DeleteRef(name, id)
793 793
794 def GetUploadableBranches(self): 794 def GetUploadableBranches(self, selected_branch=None):
795 """List any branches which can be uploaded for review. 795 """List any branches which can be uploaded for review.
796 """ 796 """
797 heads = {} 797 heads = {}
@@ -807,6 +807,8 @@ class Project(object):
807 for branch, id in heads.iteritems(): 807 for branch, id in heads.iteritems():
808 if branch in pubed and pubed[branch] == id: 808 if branch in pubed and pubed[branch] == id:
809 continue 809 continue
810 if selected_branch and branch != selected_branch:
811 continue
810 812
811 rb = self.GetUploadableBranch(branch) 813 rb = self.GetUploadableBranch(branch)
812 if rb: 814 if rb:
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