Commit 76ea456e authored by Yasuhiro Matsumoto's avatar Yasuhiro Matsumoto Committed by Russ Cox

hgpatch: do not use hg exit status

Fixes #2243.

R=rsc
CC=golang-dev
https://golang.org/cl/5146041
parent 394842e2
...@@ -268,9 +268,10 @@ func hgRoot() (string, os.Error) { ...@@ -268,9 +268,10 @@ func hgRoot() (string, os.Error) {
// hgIncoming returns true if hg sync will pull in changes. // hgIncoming returns true if hg sync will pull in changes.
func hgIncoming() bool { func hgIncoming() bool {
// hg -q incoming exits 0 when there is nothing incoming, 1 otherwise. // Cannot trust hg's exit code on Windows,
_, err := run([]string{"hg", "-q", "incoming"}, nil) // so look at whether hg prints any output.
return err == nil out, _ := run([]string{"hg", "-q", "incoming"}, nil)
return len(out) > 0
} }
// hgModified returns a list of the modified files in the // hgModified returns a list of the modified files in the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment