Commit 2d5f039d authored by Stefan Zager's avatar Stefan Zager Committed by Commit Bot

Support --nocommit option to git-cl-patch for gerrit.

R=agable@chromium.org,tandrii@chromium.org

Bug:
Change-Id: I7a5ec6ca1bb05d67b1ddbee60eac89d57464a480
Reviewed-on: https://chromium-review.googlesource.com/710007Reviewed-by: 's avatarAndrii Shyshkalov <tandrii@chromium.org>
Commit-Queue: Stefan Zager <szager@chromium.org>
parent 8d72d02c
...@@ -2782,7 +2782,6 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase): ...@@ -2782,7 +2782,6 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
def CMDPatchWithParsedIssue(self, parsed_issue_arg, reject, nocommit, def CMDPatchWithParsedIssue(self, parsed_issue_arg, reject, nocommit,
directory, force): directory, force):
assert not reject assert not reject
assert not nocommit
assert not directory assert not directory
assert parsed_issue_arg.valid assert parsed_issue_arg.valid
...@@ -2817,6 +2816,9 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase): ...@@ -2817,6 +2816,9 @@ class _GerritChangelistImpl(_ChangelistCodereviewBase):
RunGit(['reset', '--hard', 'FETCH_HEAD']) RunGit(['reset', '--hard', 'FETCH_HEAD'])
print('Checked out commit for change %i patchset %i locally' % print('Checked out commit for change %i patchset %i locally' %
(parsed_issue_arg.issue, patchset)) (parsed_issue_arg.issue, patchset))
elif nocommit:
RunGit(['cherry-pick', '--no-commit', 'FETCH_HEAD'])
print('Patch applied to index.')
else: else:
RunGit(['cherry-pick', 'FETCH_HEAD']) RunGit(['cherry-pick', 'FETCH_HEAD'])
print('Committed patch for change %i patchset %i locally.' % print('Committed patch for change %i patchset %i locally.' %
...@@ -5408,8 +5410,6 @@ def CMDpatch(parser, args): ...@@ -5408,8 +5410,6 @@ def CMDpatch(parser, args):
if cl.IsGerrit(): if cl.IsGerrit():
if options.reject: if options.reject:
parser.error('--reject is not supported with Gerrit codereview.') parser.error('--reject is not supported with Gerrit codereview.')
if options.nocommit:
parser.error('--nocommit is not supported with Gerrit codereview.')
if options.directory: if options.directory:
parser.error('--directory is not supported with Gerrit codereview.') parser.error('--directory is not supported with Gerrit codereview.')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment