mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-01-02 16:14:25 +00:00
upload: add support for standard --dry-run
Change-Id: I69ea2f3170ba17bfb9e0e3771db4ecc66a736797 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255856 Tested-by: Mike Frysinger <vapier@google.com> Reviewed-by: David Pursehouse <dpursehouse@collab.net>
This commit is contained in:
parent
84685ba187
commit
819cc81c57
@ -198,6 +198,7 @@ class ReviewableBranch(object):
|
|||||||
return self._base_exists
|
return self._base_exists
|
||||||
|
|
||||||
def UploadForReview(self, people,
|
def UploadForReview(self, people,
|
||||||
|
dryrun=False,
|
||||||
auto_topic=False,
|
auto_topic=False,
|
||||||
hashtags=(),
|
hashtags=(),
|
||||||
draft=False,
|
draft=False,
|
||||||
@ -207,8 +208,9 @@ class ReviewableBranch(object):
|
|||||||
dest_branch=None,
|
dest_branch=None,
|
||||||
validate_certs=True,
|
validate_certs=True,
|
||||||
push_options=None):
|
push_options=None):
|
||||||
self.project.UploadForReview(self.name,
|
self.project.UploadForReview(branch=self.name,
|
||||||
people,
|
people=people,
|
||||||
|
dryrun=dryrun,
|
||||||
auto_topic=auto_topic,
|
auto_topic=auto_topic,
|
||||||
hashtags=hashtags,
|
hashtags=hashtags,
|
||||||
draft=draft,
|
draft=draft,
|
||||||
@ -1332,6 +1334,7 @@ class Project(object):
|
|||||||
|
|
||||||
def UploadForReview(self, branch=None,
|
def UploadForReview(self, branch=None,
|
||||||
people=([], []),
|
people=([], []),
|
||||||
|
dryrun=False,
|
||||||
auto_topic=False,
|
auto_topic=False,
|
||||||
hashtags=(),
|
hashtags=(),
|
||||||
draft=False,
|
draft=False,
|
||||||
@ -1369,6 +1372,8 @@ class Project(object):
|
|||||||
if url is None:
|
if url is None:
|
||||||
raise UploadError('review not configured')
|
raise UploadError('review not configured')
|
||||||
cmd = ['push']
|
cmd = ['push']
|
||||||
|
if dryrun:
|
||||||
|
cmd.append('-n')
|
||||||
|
|
||||||
if url.startswith('ssh://'):
|
if url.startswith('ssh://'):
|
||||||
cmd.append('--receive-pack=gerrit receive-pack')
|
cmd.append('--receive-pack=gerrit receive-pack')
|
||||||
|
@ -181,6 +181,9 @@ Gerrit Code Review: https://www.gerritcodereview.com/
|
|||||||
type='string', action='store', dest='dest_branch',
|
type='string', action='store', dest='dest_branch',
|
||||||
metavar='BRANCH',
|
metavar='BRANCH',
|
||||||
help='Submit for review on this target branch.')
|
help='Submit for review on this target branch.')
|
||||||
|
p.add_option('-n', '--dry-run',
|
||||||
|
dest='dryrun', default=False, action='store_true',
|
||||||
|
help='Do everything except actually upload the CL.')
|
||||||
p.add_option('--no-cert-checks',
|
p.add_option('--no-cert-checks',
|
||||||
dest='validate_certs', action='store_false', default=True,
|
dest='validate_certs', action='store_false', default=True,
|
||||||
help='Disable verifying ssl certs (unsafe).')
|
help='Disable verifying ssl certs (unsafe).')
|
||||||
@ -423,6 +426,7 @@ Gerrit Code Review: https://www.gerritcodereview.com/
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
branch.UploadForReview(people,
|
branch.UploadForReview(people,
|
||||||
|
dryrun=opt.dryrun,
|
||||||
auto_topic=opt.auto_topic,
|
auto_topic=opt.auto_topic,
|
||||||
hashtags=hashtags,
|
hashtags=hashtags,
|
||||||
draft=opt.draft,
|
draft=opt.draft,
|
||||||
|
Loading…
Reference in New Issue
Block a user