]> Cypherpunks repositories - gostls13.git/commitdiff
codereview: don't mail change lists with no files
authorRyan Hitchman <hitchmanr@gmail.com>
Wed, 19 Jan 2011 19:46:06 +0000 (14:46 -0500)
committerRuss Cox <rsc@golang.org>
Wed, 19 Jan 2011 19:46:06 +0000 (14:46 -0500)
R=rsc
CC=golang-dev
https://golang.org/cl/3561041

lib/codereview/codereview.py

index e8c84abec296f57d3392b7d0aa71ad792a8d92a3..0a345d8f66f0eb633fb9e7a09d06c7380fd89c5d 100644 (file)
@@ -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)"""