From 50231fa19f7c88834edd95836dca95267ef8bb4f Mon Sep 17 00:00:00 2001 From: Rob Pike Date: Tue, 26 Mar 2013 17:32:22 -0700 Subject: [PATCH] lib/codereview/codereview.py: fix crash when hg gofmt has no files 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/codereview/codereview.py b/lib/codereview/codereview.py index 11766fcb23..f839263c55 100644 --- a/lib/codereview/codereview.py +++ b/lib/codereview/codereview.py @@ -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: -- 2.48.1