]> Cypherpunks repositories - gostls13.git/commitdiff
make hg mail more forgiving:
authorRuss Cox <rsc@golang.org>
Mon, 9 Nov 2009 06:13:10 +0000 (22:13 -0800)
committerRuss Cox <rsc@golang.org>
Mon, 9 Nov 2009 06:13:10 +0000 (22:13 -0800)
create CL first, even if gofmt is needed
or no reviewers listed.

R=r
http://go/go-review/1025025

lib/codereview/codereview.py

index e5878e296d06c8cb65faee57a700b304c3888bc3..9bf37383037db95989974221828beadaa6791d8a 100644 (file)
@@ -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: