This CL updates svn vctest so they work on Windows.
Side effect is that svn logs are no longer timezone dependant, as this
updated the `svn log` command to format logs using XML, which contain
UTC dates instead of local dates. Therefore it supersedes
https://go-review.googlesource.com/c/go/+/447795.
Fixes #56555
Fixes #56527
Change-Id: I5a654fd0a0f741e0a8a6ca7021ad699c07b974d6
Reviewed-on: https://go-review.googlesource.com/c/go/+/447935
Reviewed-by: Benny Siegert <bsiegert@gmail.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Quim Muntal <quimmuntal@gmail.com>
tempEnvName(),
"SYSTEMROOT", // must be preserved on Windows to find DLLs; golang.org/issue/25210
"WINDIR", // must be preserved on Windows to be able to run PowerShell command; golang.org/issue/30711
+ "ComSpec", // must be preserved on Windows to be able to run Batch files; golang.org/issue/56555
"DYLD_LIBRARY_PATH", // must be preserved on macOS systems to find shared libraries
"LD_LIBRARY_PATH", // must be preserved on Unix systems to find shared libraries
"LIBRARY_PATH", // allow override of non-standard static library paths
handle svn
-env TZ='America/New_York'
-
mkdir db/transactions
mkdir db/txn-protorevs
chmod 0755 hooks/pre-revprop-change
env ROOT=$PWD
cd .checkout
-svn checkout file://$ROOT .
+[GOOS:windows] svn checkout file:///$ROOT .
+[!GOOS:windows] svn checkout file://$ROOT .
svn add hello.go
svn commit --file MSG
svn propset svn:date '2017-09-22T01:12:45.861368Z' --revprop -r1
svn update
-svn log
+svn log --xml
+
+[GOOS:windows] replace '\n' '\r\n' .svn-log
cmp stdout .svn-log
-- .checkout/MSG --
println("hello, world")
}
-- .checkout/.svn-log --
-------------------------------------------------------------------------
-r1 | rsc | 2017-09-21 21:12:45 -0400 (Thu, 21 Sep 2017) | 3 lines
-
-hello world
-
+<?xml version="1.0" encoding="UTF-8"?>
+<log>
+<logentry
+ revision="1">
+<author>rsc</author>
+<date>2017-09-22T01:12:45.861368Z</date>
+<msg>hello world
-------------------------------------------------------------------------
+</msg>
+</logentry>
+</log>
-- conf/authz --
-- conf/passwd --
-- conf/svnserve.conf --
5
-- hooks/pre-revprop-change --
#!/bin/sh
+
+-- hooks/pre-revprop-change.bat --
+@exit
env GIT_AUTHOR_EMAIL='rsc@golang.org'
env GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME
env GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL
-env TZ='America/New_York'
mkdir db/transactions
mkdir db/txn-protorevs
env ROOT=$PWD
cd .checkout
-svn checkout file://$ROOT .
+[GOOS:windows] svn checkout file:///$ROOT .
+[!GOOS:windows] svn checkout file://$ROOT .
cd git-README-only
git init
svn propset svn:date 2017-10-04T15:08:26.291877Z --revprop -r5
svn update
-svn log
+svn log --xml
+
+[GOOS:windows] replace '\n' '\r\n' .svn-log
cmp stdout .svn-log
-- .checkout/git-README-only/pkg/pkg.go --
-- .checkout/tiny/tiny.go --
package tiny
-- .checkout/.svn-log --
-------------------------------------------------------------------------
-r5 | rsc | 2017-10-04 11:08:26 -0400 (Wed, 04 Oct 2017) | 1 line
-
-move from vcs-test.swtch.com to vcs-test.golang.org
-------------------------------------------------------------------------
-r4 | rsc | 2017-09-27 13:48:18 -0400 (Wed, 27 Sep 2017) | 1 line
-
-add tiny
-------------------------------------------------------------------------
-r3 | rsc | 2017-09-22 12:56:16 -0400 (Fri, 22 Sep 2017) | 1 line
-
-add other
-------------------------------------------------------------------------
-r2 | rsc | 2017-09-22 11:49:11 -0400 (Fri, 22 Sep 2017) | 1 line
-
-use git-README-only/pkg
-------------------------------------------------------------------------
-r1 | rsc | 2017-09-22 11:41:54 -0400 (Fri, 22 Sep 2017) | 1 line
-
-add modified git-README-only
-------------------------------------------------------------------------
+<?xml version="1.0" encoding="UTF-8"?>
+<log>
+<logentry
+ revision="5">
+<author>rsc</author>
+<date>2017-10-04T15:08:26.291877Z</date>
+<msg>move from vcs-test.swtch.com to vcs-test.golang.org</msg>
+</logentry>
+<logentry
+ revision="4">
+<author>rsc</author>
+<date>2017-09-27T17:48:18.350817Z</date>
+<msg>add tiny</msg>
+</logentry>
+<logentry
+ revision="3">
+<author>rsc</author>
+<date>2017-09-22T16:56:16.665173Z</date>
+<msg>add other</msg>
+</logentry>
+<logentry
+ revision="2">
+<author>rsc</author>
+<date>2017-09-22T15:49:11.130406Z</date>
+<msg>use git-README-only/pkg</msg>
+</logentry>
+<logentry
+ revision="1">
+<author>rsc</author>
+<date>2017-09-22T15:41:54.145716Z</date>
+<msg>add modified git-README-only</msg>
+</logentry>
+</log>
-- conf/authz --
-- conf/passwd --
-- conf/svnserve.conf --
5
-- hooks/pre-revprop-change --
#!/bin/sh
+
+-- hooks/pre-revprop-change.bat --
+@exit
env GIT_AUTHOR_EMAIL='rsc@golang.org'
env GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME
env GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL
-env TZ='America/New_York'
mkdir db/transactions
mkdir db/txn-protorevs
env ROOT=$PWD
cd .checkout
-svn checkout file://$ROOT .
+[GOOS:windows] svn checkout file:///$ROOT .
+[!GOOS:windows] svn checkout file://$ROOT .
git init
git config --add core.ignorecase true
svn propset svn:date 2017-10-04T15:09:35.963034Z --revprop -r3
svn update
-svn log
+svn log --xml
+
+[GOOS:windows] replace '\n' '\r\n' .svn-log
cmp stdout .svn-log
-- .checkout/.git-log --
-- .checkout/p1/p1.go --
package p1
-- .checkout/.svn-log --
-------------------------------------------------------------------------
-r3 | rsc | 2017-10-04 11:09:35 -0400 (Wed, 04 Oct 2017) | 1 line
-
-move from vcs-test.swtch.com to vcs-test.golang.org
-------------------------------------------------------------------------
-r2 | rsc | 2017-09-27 14:16:14 -0400 (Wed, 27 Sep 2017) | 1 line
-
-add p1
-------------------------------------------------------------------------
-r1 | rsc | 2017-09-27 14:00:52 -0400 (Wed, 27 Sep 2017) | 1 line
-
-git
-------------------------------------------------------------------------
+<?xml version="1.0" encoding="UTF-8"?>
+<log>
+<logentry
+ revision="3">
+<author>rsc</author>
+<date>2017-10-04T15:09:35.963034Z</date>
+<msg>move from vcs-test.swtch.com to vcs-test.golang.org</msg>
+</logentry>
+<logentry
+ revision="2">
+<author>rsc</author>
+<date>2017-09-27T18:16:14.650893Z</date>
+<msg>add p1</msg>
+</logentry>
+<logentry
+ revision="1">
+<author>rsc</author>
+<date>2017-09-27T18:00:52.201719Z</date>
+<msg>git</msg>
+</logentry>
+</log>
-- conf/authz --
-- conf/passwd --
-- conf/svnserve.conf --
5
-- hooks/pre-revprop-change --
#!/bin/sh
+
+-- hooks/pre-revprop-change.bat --
+@exit