From: Yasuhiro Matsumoto Date: Wed, 28 Sep 2011 16:00:17 +0000 (-0400) Subject: hgpatch: do not use hg exit status X-Git-Tag: weekly.2011-10-06~76 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=76ea456e450c4d49266cdab16cbaca09aa1e8af0;p=gostls13.git hgpatch: do not use hg exit status Fixes #2243. R=rsc CC=golang-dev https://golang.org/cl/5146041 --- diff --git a/src/cmd/hgpatch/main.go b/src/cmd/hgpatch/main.go index d4169ae859..e072a80d9b 100644 --- a/src/cmd/hgpatch/main.go +++ b/src/cmd/hgpatch/main.go @@ -268,9 +268,10 @@ func hgRoot() (string, os.Error) { // hgIncoming returns true if hg sync will pull in changes. func hgIncoming() bool { - // hg -q incoming exits 0 when there is nothing incoming, 1 otherwise. - _, err := run([]string{"hg", "-q", "incoming"}, nil) - return err == nil + // Cannot trust hg's exit code on Windows, + // so look at whether hg prints any output. + out, _ := run([]string{"hg", "-q", "incoming"}, nil) + return len(out) > 0 } // hgModified returns a list of the modified files in the