1 handle svn
2
3 # Note: this repo script does not produce a byte-for-byte copy of the original.
4 #
5 # The 'git init' operation in the nested Git repo creates some sample files
6 # whose contents depend on the exact Git version in use, and the steps we take
7 # to construct a fake 'git clone' status don't produce some log files that
8 # a real 'git clone' leaves behind.
9 #
10 # However, the repo is probably accurate enough for the tests that need it.
11
12 env GIT_AUTHOR_NAME='Russ Cox'
13 env GIT_AUTHOR_EMAIL='rsc@golang.org'
14 env GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME
15 env GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL
16
17 mkdir db/transactions
18 mkdir db/txn-protorevs
19 chmod 0755 hooks/pre-revprop-change
20
21 env ROOT=$PWD
22 cd .checkout
23 [GOOS:windows] svn checkout file:///$ROOT .
24 [!GOOS:windows] svn checkout file://$ROOT .
25
26 git init
27 git config --add core.ignorecase true
28 git config --add core.precomposeunicode true
29
30 git add README
31 at 2017-09-22T11:39:03-04:00
32 git commit -a -m 'README'
33 git branch -m master
34
35 git rev-parse HEAD
36 stdout '^7f800d2ac276dd7042ea0e8d7438527d236fd098$'
37
38 # Fake a clone from an origin repo at this commit.
39 git remote add origin https://vcs-test.swtch.com/git/README-only
40 mkdir .git/refs/remotes/origin
41 echo 'ref: refs/remotes/origin/master'
42 cp stdout .git/refs/remotes/origin/HEAD
43 unquote '# pack-refs with: peeled fully-peeled \n7f800d2ac276dd7042ea0e8d7438527d236fd098 refs/remotes/origin/master\n'
44 cp stdout .git/packed-refs
45 git branch --set-upstream-to=origin/master
46
47 git add pkg/pkg.go
48 at 2017-09-22T11:41:28-04:00
49 git commit -a -m 'add pkg'
50
51 git log --oneline --decorate=short
52 cmp stdout .git-log
53
54 rm README
55
56 svn add .git pkg
57 svn commit -m 'git'
58 svn propset svn:author rsc --revprop -r1
59 svn propset svn:date 2017-09-27T18:00:52.201719Z --revprop -r1
60
61 svn add p1
62 svn commit -m 'add p1'
63 svn propset svn:author rsc --revprop -r2
64 svn propset svn:date 2017-09-27T18:16:14.650893Z --revprop -r2
65
66 git remote set-url origin https://vcs-test.golang.org/git/README-only
67 svn commit -m 'move from vcs-test.swtch.com to vcs-test.golang.org'
68 svn propset svn:author rsc --revprop -r3
69 svn propset svn:date 2017-10-04T15:09:35.963034Z --revprop -r3
70
71 svn update
72 svn log --xml
73
74 [GOOS:windows] replace '\n' '\r\n' .svn-log
75 cmp stdout .svn-log
76
77 -- .checkout/.git-log --
78 ab9f66b (HEAD -> master) add pkg
79 7f800d2 (origin/master, origin/HEAD) README
80 -- .checkout/p1/p1.go --
81 package p1
82 -- .checkout/pkg/pkg.go --
83 package pkg
84 const Message = "code not in git-README-only"
85 -- .checkout/README --
86 README
87 -- .checkout/p1/p1.go --
88 package p1
89 -- .checkout/.svn-log --
90 <?xml version="1.0" encoding="UTF-8"?>
91 <log>
92 <logentry
93 revision="3">
94 <author>rsc</author>
95 <date>2017-10-04T15:09:35.963034Z</date>
96 <msg>move from vcs-test.swtch.com to vcs-test.golang.org</msg>
97 </logentry>
98 <logentry
99 revision="2">
100 <author>rsc</author>
101 <date>2017-09-27T18:16:14.650893Z</date>
102 <msg>add p1</msg>
103 </logentry>
104 <logentry
105 revision="1">
106 <author>rsc</author>
107 <date>2017-09-27T18:00:52.201719Z</date>
108 <msg>git</msg>
109 </logentry>
110 </log>
111 -- conf/authz --
112 -- conf/passwd --
113 -- conf/svnserve.conf --
114 -- db/current --
115 0
116 -- db/format --
117 6
118 layout sharded 1000
119 -- db/fs-type --
120 fsfs
121 -- db/fsfs.conf --
122 -- db/min-unpacked-rev --
123 0
124 -- db/revprops/0/0 --
125 K 8
126 svn:date
127 V 27
128 2017-09-22T01:11:53.895835Z
129 END
130 -- db/revs/0/0 --
131 PLAIN
132 END
133 ENDREP
134 id: 0.0.r0/17
135 type: dir
136 count: 0
137 text: 0 0 4 4 2d2977d1c96f487abe4a1e202dd03b4e
138 cpath: /
139
140
141 17 107
142 -- db/txn-current --
143 0
144 -- db/txn-current-lock --
145 -- db/uuid --
146 53cccb44-0fca-40a2-b0c5-acaf9e75039a
147 -- db/write-lock --
148 -- format --
149 5
150 -- hooks/pre-revprop-change --
151 #!/bin/sh
152
153 -- hooks/pre-revprop-change.bat --
154 @exit
155
View as plain text