diff options
| -rw-r--r-- | project.py | 9 | ||||
| -rw-r--r-- | subcmds/upload.py | 4 |
2 files changed, 11 insertions, 2 deletions
| @@ -198,6 +198,7 @@ class ReviewableBranch(object): | |||
| 198 | return self._base_exists | 198 | return self._base_exists |
| 199 | 199 | ||
| 200 | def UploadForReview(self, people, | 200 | def UploadForReview(self, people, |
| 201 | dryrun=False, | ||
| 201 | auto_topic=False, | 202 | auto_topic=False, |
| 202 | hashtags=(), | 203 | hashtags=(), |
| 203 | draft=False, | 204 | draft=False, |
| @@ -207,8 +208,9 @@ class ReviewableBranch(object): | |||
| 207 | dest_branch=None, | 208 | dest_branch=None, |
| 208 | validate_certs=True, | 209 | validate_certs=True, |
| 209 | push_options=None): | 210 | push_options=None): |
| 210 | self.project.UploadForReview(self.name, | 211 | self.project.UploadForReview(branch=self.name, |
| 211 | people, | 212 | people=people, |
| 213 | dryrun=dryrun, | ||
| 212 | auto_topic=auto_topic, | 214 | auto_topic=auto_topic, |
| 213 | hashtags=hashtags, | 215 | hashtags=hashtags, |
| 214 | draft=draft, | 216 | draft=draft, |
| @@ -1332,6 +1334,7 @@ class Project(object): | |||
| 1332 | 1334 | ||
| 1333 | def UploadForReview(self, branch=None, | 1335 | def UploadForReview(self, branch=None, |
| 1334 | people=([], []), | 1336 | people=([], []), |
| 1337 | dryrun=False, | ||
| 1335 | auto_topic=False, | 1338 | auto_topic=False, |
| 1336 | hashtags=(), | 1339 | hashtags=(), |
| 1337 | draft=False, | 1340 | draft=False, |
| @@ -1369,6 +1372,8 @@ class Project(object): | |||
| 1369 | if url is None: | 1372 | if url is None: |
| 1370 | raise UploadError('review not configured') | 1373 | raise UploadError('review not configured') |
| 1371 | cmd = ['push'] | 1374 | cmd = ['push'] |
| 1375 | if dryrun: | ||
| 1376 | cmd.append('-n') | ||
| 1372 | 1377 | ||
| 1373 | if url.startswith('ssh://'): | 1378 | if url.startswith('ssh://'): |
| 1374 | cmd.append('--receive-pack=gerrit receive-pack') | 1379 | cmd.append('--receive-pack=gerrit receive-pack') |
diff --git a/subcmds/upload.py b/subcmds/upload.py index 633ddc81..6ef4955e 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py | |||
| @@ -181,6 +181,9 @@ Gerrit Code Review: https://www.gerritcodereview.com/ | |||
| 181 | type='string', action='store', dest='dest_branch', | 181 | type='string', action='store', dest='dest_branch', |
| 182 | metavar='BRANCH', | 182 | metavar='BRANCH', |
| 183 | help='Submit for review on this target branch.') | 183 | help='Submit for review on this target branch.') |
| 184 | p.add_option('-n', '--dry-run', | ||
| 185 | dest='dryrun', default=False, action='store_true', | ||
| 186 | help='Do everything except actually upload the CL.') | ||
| 184 | p.add_option('--no-cert-checks', | 187 | p.add_option('--no-cert-checks', |
| 185 | dest='validate_certs', action='store_false', default=True, | 188 | dest='validate_certs', action='store_false', default=True, |
| 186 | help='Disable verifying ssl certs (unsafe).') | 189 | help='Disable verifying ssl certs (unsafe).') |
| @@ -423,6 +426,7 @@ Gerrit Code Review: https://www.gerritcodereview.com/ | |||
| 423 | continue | 426 | continue |
| 424 | 427 | ||
| 425 | branch.UploadForReview(people, | 428 | branch.UploadForReview(people, |
| 429 | dryrun=opt.dryrun, | ||
| 426 | auto_topic=opt.auto_topic, | 430 | auto_topic=opt.auto_topic, |
| 427 | hashtags=hashtags, | 431 | hashtags=hashtags, |
| 428 | draft=opt.draft, | 432 | draft=opt.draft, |
