Merge "Use new %topic=XXXX syntax for topic pushes"
This commit is contained in:
commit
f6260701fa
@ -1675,16 +1675,18 @@ def _main():
|
||||
run_custom_script("draft")
|
||||
|
||||
cmd = "git push %s HEAD:refs/%s/%s" % (remote, ref, branch)
|
||||
push_options = []
|
||||
if options.topic is not None:
|
||||
topic = options.topic
|
||||
else:
|
||||
topic = None if options.notopic else get_topic(branch)
|
||||
|
||||
if topic and topic != branch:
|
||||
cmd += "/%s" % topic
|
||||
push_options.append("topic=%s" % topic)
|
||||
|
||||
if options.reviewers:
|
||||
assert_valid_reviewers(options.reviewers)
|
||||
cmd += "%" + ",".join("r=%s" % r for r in options.reviewers)
|
||||
push_options += ["r=%s" % r for r in options.reviewers]
|
||||
|
||||
if options.regenerate:
|
||||
print("Amending the commit to regenerate the change id\n")
|
||||
@ -1698,17 +1700,19 @@ def _main():
|
||||
"'/^Change-Id:/d'")
|
||||
|
||||
if options.wip:
|
||||
cmd += '\%wip'
|
||||
push_options.append('wip')
|
||||
|
||||
if options.ready:
|
||||
cmd += '\%ready'
|
||||
push_options.append('ready')
|
||||
|
||||
if options.private:
|
||||
cmd += '\%private'
|
||||
push_options.append('private')
|
||||
|
||||
if options.remove_private:
|
||||
cmd += '\%remove-private'
|
||||
push_options.append('remove-private')
|
||||
|
||||
if push_options:
|
||||
cmd += "%" + ",".join(push_options)
|
||||
if options.dry:
|
||||
print("Please use the following command "
|
||||
"to send your commits to review:\n")
|
||||
|
@ -386,12 +386,13 @@ class GitReviewTestCase(tests.BaseGitReviewTestCase):
|
||||
def test_git_review_t(self):
|
||||
self._run_git_review('-s')
|
||||
self._simple_change('test file modified', 'commit message for bug 654')
|
||||
self._assert_branch_would_be('master/zat', extra_args=['-t', 'zat'])
|
||||
self._assert_branch_would_be('master%topic=zat',
|
||||
extra_args=['-t', 'zat'])
|
||||
|
||||
def test_bug_topic(self):
|
||||
self._run_git_review('-s')
|
||||
self._simple_change('a change', 'new change for bug 123')
|
||||
self._assert_branch_would_be('master/bug/123')
|
||||
self._assert_branch_would_be('master%topic=bug/123')
|
||||
|
||||
def test_bug_topic_newline(self):
|
||||
self._run_git_review('-s')
|
||||
@ -401,7 +402,7 @@ class GitReviewTestCase(tests.BaseGitReviewTestCase):
|
||||
def test_bp_topic(self):
|
||||
self._run_git_review('-s')
|
||||
self._simple_change('a change', 'new change for blueprint asdf')
|
||||
self._assert_branch_would_be('master/bp/asdf')
|
||||
self._assert_branch_would_be('master%topic=bp/asdf')
|
||||
|
||||
def test_bp_topic_newline(self):
|
||||
self._run_git_review('-s')
|
||||
@ -475,7 +476,7 @@ class GitReviewTestCase(tests.BaseGitReviewTestCase):
|
||||
def test_git_review_T(self):
|
||||
self._run_git_review('-s')
|
||||
self._simple_change('test file modified', 'commit message for bug 456')
|
||||
self._assert_branch_would_be('master/bug/456')
|
||||
self._assert_branch_would_be('master%topic=bug/456')
|
||||
self._assert_branch_would_be('master', extra_args=['-T'])
|
||||
|
||||
def test_git_review_T_t(self):
|
||||
|
Loading…
x
Reference in New Issue
Block a user