]> Cypherpunks repositories - gostls13.git/commitdiff
codereview: print gofmt message when aborting
authorRuss Cox <rsc@golang.org>
Sat, 7 Nov 2009 02:40:30 +0000 (18:40 -0800)
committerRuss Cox <rsc@golang.org>
Sat, 7 Nov 2009 02:40:30 +0000 (18:40 -0800)
R=r
CC=vish
http://go/go-review/1026013

lib/codereview/codereview.py

index a169157182d64b1d6f538a57384b08253356cc73..2cd3018617680919378fed406b1b522221ba8a6a 100644 (file)
@@ -594,11 +594,11 @@ def CheckGofmt(ui, repo, files, just_warn=False):
                ui.warn("gofmt errors:\n" + errors.rstrip() + "\n")
                return
        if len(data) > 0:
-               msg = "gofmt needs to format these files (run hg gofmt):\n" + data
+               msg = "gofmt needs to format these files (run hg gofmt):\n" + Indent(data, "\t").rstrip()
                if just_warn:
-                       ui.warn("warning: " + msg)
+                       ui.warn("warning: " + msg + "\n")
                else:
-                       raise util.Abort()
+                       raise util.Abort(msg)
        return
 
 #######################################################################