1
0
mirror of https://github.com/golang/go synced 2024-11-22 03:34:40 -07:00

hgpatch: do not use hg exit status

Fixes #2243.

R=rsc
CC=golang-dev
https://golang.org/cl/5146041
This commit is contained in:
Yasuhiro Matsumoto 2011-09-28 12:00:17 -04:00 committed by Russ Cox
parent 394842e2a5
commit 76ea456e45

View File

@ -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