From b1a52ce4a3eafe41b15c224e67debff60475b26f Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sun, 8 Nov 2009 22:13:10 -0800 Subject: [PATCH] make hg mail more forgiving: create CL first, even if gofmt is needed or no reviewers listed. R=r http://go/go-review/1025025 --- lib/codereview/codereview.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/codereview/codereview.py b/lib/codereview/codereview.py index e5878e296d0..9bf37383037 100644 --- a/lib/codereview/codereview.py +++ b/lib/codereview/codereview.py @@ -896,9 +896,9 @@ def mail(ui, repo, *pats, **opts): cl, err = CommandLineCL(ui, repo, pats, opts) if err != "": return err + cl.Upload(ui, repo, gofmt_just_warn=True) if not cl.reviewer: return "no reviewers listed in CL" - cl.Upload(ui, repo) pmsg = "Hello " + JoinComma(cl.reviewer) if cl.cc: pmsg += " (cc: %s)" % (', '.join(cl.cc),) @@ -1002,7 +1002,12 @@ def submit(ui, repo, *pats, **opts): # upload, to sync current patch and also get change number if CL is new. if not cl.original_author: - cl.Upload(ui, repo) + cl.Upload(ui, repo, gofmt_just_warn=True) + + # check gofmt for real; allowed upload to warn in order to save CL. + cl.Flush(ui, repo) + CheckGofmt(ui, repo, cl.files) + about += "%s%s\n" % (server_url_base, cl.name) if cl.original_author: