diff --git a/docs/internal-fs-layout.md b/docs/internal-fs-layout.md index 530252b1..b06e898f 100644 --- a/docs/internal-fs-layout.md +++ b/docs/internal-fs-layout.md @@ -195,6 +195,7 @@ The `[branch]` settings are updated by `repo start` and `git branch`. | review.\.autoupload | upload | Automatically answer "yes" or "no" to all prompts | | review.\.uploadhashtags | upload | Automatically add to `--hashtag=` | | review.\.uploadlabels | upload | Automatically add to `--label=` | +| review.\.uploadnotify | upload | [Notify setting][upload-notify] to use | | review.\.uploadtopic | upload | Default [topic] to use | | review.\.username | upload | Override username with `ssh://` review URIs | | remote.\.fetch | sync | Set of refs to fetch | @@ -227,3 +228,4 @@ Repo will create & maintain a few files in the user's home directory. [manifest-format.md]: ./manifest-format.md [local manifests]: ./manifest-format.md#Local-Manifests [topic]: https://gerrit-review.googlesource.com/Documentation/intro-user.html#topics +[upload-notify]: https://gerrit-review.googlesource.com/Documentation/user-upload.html#notify diff --git a/subcmds/upload.py b/subcmds/upload.py index 9c4337dc..cf3c8a9f 100644 --- a/subcmds/upload.py +++ b/subcmds/upload.py @@ -142,6 +142,11 @@ To add labels whenever uploading a commit, you can set a per-project or global Git option to do so. The value of review.URL.uploadlabels will be used as comma delimited labels like the --label option. +review.URL.uploadnotify: + +Control e-mail notifications when uploading. +https://gerrit-review.googlesource.com/Documentation/user-upload.html#notify + # References Gerrit Code Review: https://www.gerritcodereview.com/ @@ -445,6 +450,13 @@ Gerrit Code Review: https://www.gerritcodereview.com/ 'like CodeReview+1 or Verified-1' % (label,), file=sys.stderr) sys.exit(1) + # Handle e-mail notifications. + if opt.notify is False: + notify = 'NONE' + else: + key = 'review.%s.uploadnotify' % branch.project.remote.review + notify = branch.project.config.GetString(key) + destination = opt.dest_branch or branch.project.dest_branch # Make sure our local branch is not setup to track a different remote branch @@ -466,7 +478,7 @@ Gerrit Code Review: https://www.gerritcodereview.com/ hashtags=hashtags, labels=labels, private=opt.private, - notify=None if opt.notify else 'NONE', + notify=notify, wip=opt.wip, dest_branch=destination, validate_certs=opt.validate_certs,