]> Cypherpunks repositories - gostls13.git/commitdiff
lib/codereview/codereview.py: fix crash when hg gofmt has no files
authorRob Pike <r@golang.org>
Wed, 27 Mar 2013 00:32:22 +0000 (17:32 -0700)
committerRob Pike <r@golang.org>
Wed, 27 Mar 2013 00:32:22 +0000 (17:32 -0700)
The gofmt function was returning a string, which isn't the right type.
Three cheers for dynamic typing.

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/7917044

lib/codereview/codereview.py

index 11766fcb23a76836042ff463947083bb7fd2c8e9..f839263c55746442ff25fcf5482ebb699ec8861d 100644 (file)
@@ -1762,7 +1762,8 @@ def gofmt(ui, repo, *pats, **opts):
        files = ChangedExistingFiles(ui, repo, pats, opts)
        files = gofmt_required(files)
        if not files:
-               return "no modified go files"
+               ui.status("no modified go files\n")
+               return
        cwd = os.getcwd()
        files = [RelativePath(repo.root + '/' + f, cwd) for f in files]
        try: