Migrate git-repo to create private changes rather than drafts

Considering that some users might expect changes created with
'-d' option are not public. Private changes may be a better
choice here than work-in-progress changes.

Change-Id: I46a8fb9ae38beb41cf96d6abe82bea6db2439669
This commit is contained in:
Changcheng Xiao
2017-08-07 15:05:46 +02:00
parent 87984c6db4
commit d88f53e2b9
2 changed files with 4 additions and 13 deletions

View File

@ -175,14 +175,12 @@ class ReviewableBranch(object):
def UploadForReview(self, people,
auto_topic=False,
draft=False,
private=False,
wip=False,
dest_branch=None):
self.project.UploadForReview(self.name,
people,
auto_topic=auto_topic,
draft=draft,
private=private,
wip=wip,
dest_branch=dest_branch)
@ -1110,7 +1108,6 @@ class Project(object):
def UploadForReview(self, branch=None,
people=([], []),
auto_topic=False,
draft=False,
private=False,
wip=False,
dest_branch=None):
@ -1156,12 +1153,7 @@ class Project(object):
if dest_branch.startswith(R_HEADS):
dest_branch = dest_branch[len(R_HEADS):]
upload_type = 'for'
if draft:
upload_type = 'drafts'
ref_spec = '%s:refs/%s/%s' % (R_HEADS + branch.name, upload_type,
dest_branch)
ref_spec = '%s:refs/for/%s' % (R_HEADS + branch.name, dest_branch)
if auto_topic:
ref_spec = ref_spec + '/' + branch.name