|
1 | 1 | handle hg |
2 | 2 |
|
3 | | -mkdir git |
4 | | -cd git |
5 | | - |
6 | | -env GIT_AUTHOR_NAME='Russ Cox' |
7 | | -env GIT_AUTHOR_EMAIL='rsc@golang.org' |
8 | | -env GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME |
9 | | -env GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL |
10 | | - |
11 | | -git init |
| 3 | +hg init |
12 | 4 |
|
13 | | -at 2018-04-17T15:43:22-04:00 |
| 5 | +env date=2018-04-17T15:43:22-04:00 |
14 | 6 | unquote '' |
15 | 7 | cp stdout README |
16 | | -git add README |
17 | | -git commit -a -m 'empty README' |
18 | | -git branch -m master |
19 | | -git tag v1.2.3 |
| 8 | +hg add README |
| 9 | +hg commit --user=rsc --date=$date -m 'empty README' |
| 10 | +hg branch tagbranch |
| 11 | +hg tag --user=rsc --date=$date v1.2.3 |
| 12 | +hg update default |
20 | 13 |
|
21 | | -at 2018-04-17T15:45:48-04:00 |
22 | | -git branch v2 |
23 | | -git checkout v2 |
| 14 | +env date=2018-04-17T15:45:48-04:00 |
| 15 | +hg branch v2 |
24 | 16 | echo 'v2' |
25 | 17 | cp stdout v2 |
26 | | -git add v2 |
27 | | -git commit -a -m 'v2' |
28 | | -git tag v2.3 |
29 | | -git tag v2.0.1 |
30 | | -git branch v2.3.4 |
31 | | -git tag branch-v2.3.4 |
| 18 | +hg add v2 |
| 19 | +hg commit --user=rsc --date=$date -m 'v2' |
| 20 | +hg update tagbranch |
| 21 | +hg tag --user=rsc --date=$date -r v2 v2.3 |
| 22 | +hg tag --user=rsc --date=$date -r v2 v2.0.1 |
| 23 | +hg update v2 |
| 24 | +hg branch v2.3.4 |
32 | 25 |
|
33 | | -at 2018-04-17T16:00:19-04:00 |
| 26 | +env date=2018-04-17T16:00:19-04:00 |
34 | 27 | echo 'intermediate' |
35 | 28 | cp stdout foo.txt |
36 | | -git add foo.txt |
37 | | -git commit -a -m 'intermediate' |
| 29 | +hg add foo.txt |
| 30 | +hg commit --user=rsc --date=$date -m 'intermediate' |
38 | 31 |
|
39 | | -at 2018-04-17T16:00:32-04:00 |
| 32 | +env date=2018-04-17T16:00:32-04:00 |
40 | 33 | echo 'another' |
41 | 34 | cp stdout another.txt |
42 | | -git add another.txt |
43 | | -git commit -a -m 'another' |
44 | | -git tag v2.0.2 |
45 | | -git tag branch-v2 |
| 35 | +hg add another.txt |
| 36 | +hg commit --user=rsc --date=$date -m 'another' |
| 37 | +hg update tagbranch |
| 38 | +hg tag --user=rsc --date=$date -r v2.3.4 v2.0.2 |
46 | 39 |
|
47 | | -at 2018-04-17T16:16:52-04:00 |
48 | | -git checkout master |
49 | | -git branch v3 |
50 | | -git checkout v3 |
| 40 | +env date=2018-04-17T16:16:52-04:00 |
| 41 | +hg update default |
| 42 | +hg branch v3 |
51 | 43 | mkdir v3/sub/dir |
52 | 44 | echo 'v3/sub/dir/file' |
53 | 45 | cp stdout v3/sub/dir/file.txt |
54 | | -git add v3 |
55 | | -git commit -a -m 'add v3/sub/dir/file.txt' |
56 | | -git tag branch-v3 |
57 | | - |
58 | | -at 2018-04-17T22:23:00-04:00 |
59 | | -git checkout master |
60 | | -git tag -a v1.2.4-annotated -m 'v1.2.4-annotated' |
| 46 | +hg add v3 |
| 47 | +hg commit --user=rsc --date=$date -m 'add v3/sub/dir/file.txt' |
61 | 48 |
|
62 | | -cd .. |
| 49 | +env date=2018-04-17T22:23:00-04:00 |
| 50 | +hg update default |
| 51 | +hg tag --user=rsc --date=$date -r v1.2.3 v1.2.4-annotated |
63 | 52 |
|
64 | | -hg init |
65 | | -hg convert --datesort ./git . |
66 | | -rm ./git |
67 | | - |
68 | | -hg update -C v2 |
69 | | -hg branch v2 |
| 53 | +env date=2018-06-27T12:15:24-04:00 |
| 54 | +hg update v2 |
70 | 55 | unquote '' |
71 | 56 | cp stdout dummy |
72 | 57 | hg add dummy |
73 | | -hg commit --user 'Russ Cox <rsc@golang.org>' --date '2018-06-27T12:15:24-04:00' -m 'dummy' |
74 | | - |
75 | | -# 'hg convert' blindly stamps a tag-update commit at the end of whatever branch |
76 | | -# happened to contain the last converted commit — in this case, v3. However, the |
77 | | -# original vcs-test.golang.org copy of this repo had this commit on the v3 |
78 | | -# branch as a descendent of 'add v3/sub/dir/file.txt', so that's where we put it |
79 | | -# here. That leaves the convert-repo 'update tags' commit only reachable as the |
80 | | -# head of the default branch. |
81 | | -hg update -r 4 |
82 | | - |
83 | | -hg branch v3 |
84 | | -unquote '' |
85 | | -cp stdout dummy |
86 | | -hg add dummy |
87 | | -hg commit --user 'Russ Cox <rsc@golang.org>' --date '2018-06-27T12:15:45-04:00' -m 'dummy' |
| 58 | +hg commit --user=rsc --date=$date -m 'dummy' |
88 | 59 |
|
| 60 | +env date=2018-06-27T12:16:10-04:00 |
89 | 61 | hg update v2.3.4 |
90 | 62 | hg branch v2.3.4 |
91 | 63 | unquote '' |
92 | 64 | cp stdout dummy |
93 | 65 | hg add dummy |
94 | | -hg commit --user 'Russ Cox <rsc@golang.org>' --date '2018-06-27T12:16:10-04:00' -m 'dummy' |
95 | | - |
96 | | -hg tag --user 'Russ Cox <rsc@golang.org>' --date '2018-06-27T12:16:30-04:00' -m 'Removed tag branch-v2, branch-v3, branch-v2.3.4' --remove branch-v2 branch-v3 branch-v2.3.4 |
| 66 | +hg commit --user=rsc --date=$date -m 'dummy' |
97 | 67 |
|
98 | | -# Adding commits to the above branches updates both the branch heads and the |
99 | | -# corresponding bookmarks. |
100 | | -# But apparently at some point it did not do so? The original copy of this repo |
101 | | -# had bookmarks pointing to the base of each branch instead of the tip. 🤔 |
102 | | -# Either way, force the bookmarks we care about to match the original copy of |
103 | | -# the repo. |
104 | | -hg book v2 -r 3 --force |
105 | | -hg book v2.3.4 -r 1 --force |
106 | | -hg book v3 -r 5 --force |
| 68 | +hg book v2 -r v2.0.2 --force |
| 69 | +hg book v2.3.4 -r v2.0.1 --force |
107 | 70 |
|
108 | 71 | hg log -G --debug |
109 | 72 |
|
110 | 73 | hg tags |
111 | 74 | cmp stdout .hg-tags |
112 | 75 |
|
113 | | - # 'hg convert' leaves an 'update tags' commit on the default branch, and that |
114 | | - # commit always uses the current date (so is not reproducible). Fortunately, |
115 | | - # that commit lands on the 'default' branch and is not tagged as 'tip', so it |
116 | | - # seems to be mostly harmless. However, because it is nondeterministic we |
117 | | - # should avoid listing it here. |
118 | | - # |
119 | | - # Unfortunately, some of our builders are still running Debian 9 “Stretch”, |
120 | | - # which shipped with a version of 'hg' that does not support 'hg branch -r' |
121 | | - # to list branches for specific versions. Although Stretch is past its |
122 | | - # end-of-life date, we need to keep the builders happy until they can be |
123 | | - # turned down (https://go.dev/issue/56414). |
124 | 76 | hg branches |
125 | | -? cmp stdout .hg-branches |
126 | | -stdout 'v2\s+6:9a4f43d231ec' |
127 | | -stdout 'v2.3.4\s+9:18518c07eb8e' |
128 | | -stdout 'v3\s+7:a2cad8a2b1bb' |
129 | | -stdout 'default\s+5:' |
| 77 | +cmp stdout .hg-branches |
130 | 78 |
|
131 | | -# Likewise, bookmark v3 ends up on the nondeterministic commit. |
132 | 79 | hg bookmarks |
133 | | -? cmp stdout .hg-bookmarks |
134 | | -stdout 'master\s+0:41964ddce118' |
135 | | -stdout 'v2\s+3:8f49ee7a6ddc' |
136 | | -stdout 'v2.3.4\s+1:88fde824ec8b' |
137 | | -stdout 'v3\s+5:.*' |
| 80 | +cmp stdout .hg-bookmarks |
138 | 81 |
|
139 | | --- .hg-branches -- |
140 | | -v2.3.4 9:18518c07eb8e |
141 | | -v3 7:a2cad8a2b1bb |
142 | | -v2 6:9a4f43d231ec |
143 | 82 | -- .hg-tags -- |
144 | | -tip 9:18518c07eb8e |
145 | | -v2.0.2 3:8f49ee7a6ddc |
146 | | -v2.3 1:88fde824ec8b |
147 | | -v2.0.1 1:88fde824ec8b |
148 | | -v1.2.4-annotated 0:41964ddce118 |
149 | | -v1.2.3 0:41964ddce118 |
| 83 | +tip 11:745aacc8b24d |
| 84 | +v2.0.2 6:b1ed98abc268 |
| 85 | +v2.3 2:a546811101e1 |
| 86 | +v2.0.1 2:a546811101e1 |
| 87 | +v1.2.4-annotated 0:c0186fb00e50 |
| 88 | +v1.2.3 0:c0186fb00e50 |
| 89 | +-- .hg-branches -- |
| 90 | +v2.3.4 11:745aacc8b24d |
| 91 | +v2 10:2b5ca8689628 |
| 92 | +default 9:a9a2a32d1392 |
| 93 | +v3 8:442174d28f65 |
| 94 | +tagbranch 7:1a3473c317b4 |
150 | 95 | -- .hg-bookmarks -- |
151 | | - master 0:41964ddce118 |
152 | | - v2 3:8f49ee7a6ddc |
153 | | - v2.3.4 1:88fde824ec8b |
| 96 | + v2 6:b1ed98abc268 |
| 97 | + v2.3.4 2:a546811101e1 |
0 commit comments