From 30c85bf14c32a836e666542b78a961e1e8fdc346 Mon Sep 17 00:00:00 2001 From: Ryan Hitchman Date: Wed, 19 Jan 2011 14:46:06 -0500 Subject: [PATCH] codereview: don't mail change lists with no files R=rsc CC=golang-dev https://golang.org/cl/3561041 --- lib/codereview/codereview.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/codereview/codereview.py b/lib/codereview/codereview.py index e8c84abec2..0a345d8f66 100644 --- a/lib/codereview/codereview.py +++ b/lib/codereview/codereview.py @@ -1134,8 +1134,12 @@ def mail(ui, repo, *pats, **opts): return "no reviewers listed in CL" cl.cc = Sub(cl.cc, defaultcc) cl.reviewer = defaultcc - cl.Flush(ui, repo) - cl.Mail(ui, repo) + cl.Flush(ui, repo) + + if cl.files == []: + return "no changed files, not sending mail" + + cl.Mail(ui, repo) def nocommit(ui, repo, *pats, **opts): """(disabled when using this extension)"""