Commit 620bd5a3 authored by Bryan C. Mills's avatar Bryan C. Mills

cmd/go: write an hgrc file in TestMoveHG

Some variants of Mercurial respond differently to “permission denied” errors
than to “file not found”, and we set HOME to point to an absolute path that may
produce the former instead of the latter.

To discourage Mercurial from trying HOME, give it an explicit (empty)
configuration in the working directory instead.

Change-Id: I82ae99a6892bba7fc3d41b77209ca181d24315e2
Reviewed-on: https://go-review.googlesource.com/136135Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent f40dc5cb
...@@ -1074,6 +1074,8 @@ func testMove(t *testing.T, vcs, url, base, config string) { ...@@ -1074,6 +1074,8 @@ func testMove(t *testing.T, vcs, url, base, config string) {
defer tg.cleanup() defer tg.cleanup()
tg.parallel() tg.parallel()
tg.tempDir("src") tg.tempDir("src")
tg.must(os.Mkdir(tg.path(".hg"), 0700))
tg.must(ioutil.WriteFile(filepath.Join(tg.path(".hg"), "hgrc"), nil, 0600))
tg.setenv("GOPATH", tg.path(".")) tg.setenv("GOPATH", tg.path("."))
tg.run("get", "-d", url) tg.run("get", "-d", url)
tg.run("get", "-d", "-u", url) tg.run("get", "-d", "-u", url)
......
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