summaryrefslogtreecommitdiff
path: root/lib/codereview/codereview.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/codereview/codereview.py')
-rw-r--r--lib/codereview/codereview.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/codereview/codereview.py b/lib/codereview/codereview.py
index 9f7470be5..a33ea38c0 100644
--- a/lib/codereview/codereview.py
+++ b/lib/codereview/codereview.py
@@ -960,8 +960,16 @@ def mail(ui, repo, *pats, **opts):
if err != "":
return err
cl.Upload(ui, repo, gofmt_just_warn=True)
- if not cl.reviewer and not cl.cc:
- return "no reviewers listed in CL"
+ if not cl.reviewer:
+ # If no reviewer is listed, assign the review to defaultcc.
+ # This makes sure that it appears in the
+ # codereview.appspot.com/user/defaultcc
+ # page, so that it doesn't get dropped on the floor.
+ if not defaultcc:
+ return "no reviewers listed in CL"
+ cl.cc = Sub(cl.cc, defaultcc)
+ cl.reviewer = defaultcc
+ cl.Flush(ui, repo)
cl.Mail(ui, repo)
def nocommit(ui, repo, *pats, **opts):