diff options
Diffstat (limited to 'project.py')
| -rw-r--r-- | project.py | 16 |
1 files changed, 12 insertions, 4 deletions
| @@ -176,10 +176,11 @@ class ReviewableBranch(object): | |||
| 176 | R_HEADS + self.name, | 176 | R_HEADS + self.name, |
| 177 | '--') | 177 | '--') |
| 178 | 178 | ||
| 179 | def UploadForReview(self, people, auto_topic=False): | 179 | def UploadForReview(self, people, auto_topic=False, draft=False): |
| 180 | self.project.UploadForReview(self.name, | 180 | self.project.UploadForReview(self.name, |
| 181 | people, | 181 | people, |
| 182 | auto_topic=auto_topic) | 182 | auto_topic=auto_topic, |
| 183 | draft=draft) | ||
| 183 | 184 | ||
| 184 | def GetPublishedRefs(self): | 185 | def GetPublishedRefs(self): |
| 185 | refs = {} | 186 | refs = {} |
| @@ -881,7 +882,8 @@ class Project(object): | |||
| 881 | 882 | ||
| 882 | def UploadForReview(self, branch=None, | 883 | def UploadForReview(self, branch=None, |
| 883 | people=([],[]), | 884 | people=([],[]), |
| 884 | auto_topic=False): | 885 | auto_topic=False, |
| 886 | draft=False): | ||
| 885 | """Uploads the named branch for code review. | 887 | """Uploads the named branch for code review. |
| 886 | """ | 888 | """ |
| 887 | if branch is None: | 889 | if branch is None: |
| @@ -920,7 +922,13 @@ class Project(object): | |||
| 920 | 922 | ||
| 921 | if dest_branch.startswith(R_HEADS): | 923 | if dest_branch.startswith(R_HEADS): |
| 922 | dest_branch = dest_branch[len(R_HEADS):] | 924 | dest_branch = dest_branch[len(R_HEADS):] |
| 923 | ref_spec = '%s:refs/for/%s' % (R_HEADS + branch.name, dest_branch) | 925 | |
| 926 | upload_type = 'for' | ||
| 927 | if draft: | ||
| 928 | upload_type = 'drafts' | ||
| 929 | |||
| 930 | ref_spec = '%s:refs/%s/%s' % (R_HEADS + branch.name, upload_type, | ||
| 931 | dest_branch) | ||
| 924 | if auto_topic: | 932 | if auto_topic: |
| 925 | ref_spec = ref_spec + '/' + branch.name | 933 | ref_spec = ref_spec + '/' + branch.name |
| 926 | cmd.append(ref_spec) | 934 | cmd.append(ref_spec) |
