From 435370c6f0e202378ae233cf1088e499ba07e971 Mon Sep 17 00:00:00 2001 From: Brian Harring Date: Sat, 28 Jul 2012 15:37:04 -0700 Subject: upload: add --draft option. Change-Id: I6967ff2f8163cd4116027b3f15ddb36875942af4 --- project.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'project.py') diff --git a/project.py b/project.py index 66a123d2..68c1c687 100644 --- a/project.py +++ b/project.py @@ -176,10 +176,11 @@ class ReviewableBranch(object): R_HEADS + self.name, '--') - def UploadForReview(self, people, auto_topic=False): + def UploadForReview(self, people, auto_topic=False, draft=False): self.project.UploadForReview(self.name, people, - auto_topic=auto_topic) + auto_topic=auto_topic, + draft=draft) def GetPublishedRefs(self): refs = {} @@ -881,7 +882,8 @@ class Project(object): def UploadForReview(self, branch=None, people=([],[]), - auto_topic=False): + auto_topic=False, + draft=False): """Uploads the named branch for code review. """ if branch is None: @@ -920,7 +922,13 @@ class Project(object): if dest_branch.startswith(R_HEADS): dest_branch = dest_branch[len(R_HEADS):] - ref_spec = '%s:refs/for/%s' % (R_HEADS + branch.name, dest_branch) + + upload_type = 'for' + if draft: + upload_type = 'drafts' + + ref_spec = '%s:refs/%s/%s' % (R_HEADS + branch.name, upload_type, + dest_branch) if auto_topic: ref_spec = ref_spec + '/' + branch.name cmd.append(ref_spec) -- cgit v1.2.3-54-g00ecf