diff options
Diffstat (limited to 'project.py')
| -rw-r--r-- | project.py | 17 |
1 files changed, 13 insertions, 4 deletions
| @@ -149,10 +149,11 @@ class ReviewableBranch(object): | |||
| 149 | R_HEADS + self.name, | 149 | R_HEADS + self.name, |
| 150 | '--') | 150 | '--') |
| 151 | 151 | ||
| 152 | def UploadForReview(self, people): | 152 | def UploadForReview(self, people, auto_topic=False): |
| 153 | self.project.UploadForReview(self.name, | 153 | self.project.UploadForReview(self.name, |
| 154 | self.replace_changes, | 154 | self.replace_changes, |
| 155 | people) | 155 | people, |
| 156 | auto_topic=auto_topic) | ||
| 156 | 157 | ||
| 157 | def GetPublishedRefs(self): | 158 | def GetPublishedRefs(self): |
| 158 | refs = {} | 159 | refs = {} |
| @@ -555,7 +556,10 @@ class Project(object): | |||
| 555 | return rb | 556 | return rb |
| 556 | return None | 557 | return None |
| 557 | 558 | ||
| 558 | def UploadForReview(self, branch=None, replace_changes=None, people=([],[])): | 559 | def UploadForReview(self, branch=None, |
| 560 | replace_changes=None, | ||
| 561 | people=([],[]), | ||
| 562 | auto_topic=False): | ||
| 559 | """Uploads the named branch for code review. | 563 | """Uploads the named branch for code review. |
| 560 | """ | 564 | """ |
| 561 | if branch is None: | 565 | if branch is None: |
| @@ -587,10 +591,15 @@ class Project(object): | |||
| 587 | for e in people[1]: | 591 | for e in people[1]: |
| 588 | rp.append('--cc=%s' % sq(e)) | 592 | rp.append('--cc=%s' % sq(e)) |
| 589 | 593 | ||
| 594 | ref_spec = '%s:refs/for/%s' % (R_HEADS + branch.name, dest_branch) | ||
| 595 | if auto_topic: | ||
| 596 | ref_spec = ref_spec + '/' + branch.name | ||
| 597 | |||
| 590 | cmd = ['push'] | 598 | cmd = ['push'] |
| 591 | cmd.append('--receive-pack=%s' % " ".join(rp)) | 599 | cmd.append('--receive-pack=%s' % " ".join(rp)) |
| 592 | cmd.append(branch.remote.SshReviewUrl(self.UserEmail)) | 600 | cmd.append(branch.remote.SshReviewUrl(self.UserEmail)) |
| 593 | cmd.append('%s:refs/for/%s' % (R_HEADS + branch.name, dest_branch)) | 601 | cmd.append(ref_spec) |
| 602 | |||
| 594 | if replace_changes: | 603 | if replace_changes: |
| 595 | for change_id,commit_id in replace_changes.iteritems(): | 604 | for change_id,commit_id in replace_changes.iteritems(): |
| 596 | cmd.append('%s:refs/changes/%s/new' % (commit_id, change_id)) | 605 | cmd.append('%s:refs/changes/%s/new' % (commit_id, change_id)) |
