]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: write an hgrc file in TestMoveHG
authorBryan C. Mills <bcmills@google.com>
Tue, 18 Sep 2018 18:00:25 +0000 (14:00 -0400)
committerBryan C. Mills <bcmills@google.com>
Wed, 19 Sep 2018 16:57:32 +0000 (16:57 +0000)
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/136135
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/go/go_test.go

index 6bd0609eaffda6ab0bc65e879ef07d41b307b761..e7d96f62360fa8db91b276efb139c5d9cc9dd947 100644 (file)
@@ -1074,6 +1074,8 @@ func testMove(t *testing.T, vcs, url, base, config string) {
        defer tg.cleanup()
        tg.parallel()
        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.run("get", "-d", url)
        tg.run("get", "-d", "-u", url)