| 1 |
handle hg |
| 2 |
|
| 3 |
cd git |
| 4 |
|
| 5 |
env GIT_AUTHOR_NAME='Russ Cox' |
| 6 |
env GIT_AUTHOR_EMAIL='[email protected]' |
| 7 |
env GIT_COMMITTER_NAME=$GIT_AUTHOR_NAME |
| 8 |
env GIT_COMMITTER_EMAIL=$GIT_AUTHOR_EMAIL |
| 9 |
|
| 10 |
git init |
| 11 |
|
| 12 |
# 0 |
| 13 |
at 2018-02-19T17:21:09-05:00 |
| 14 |
git add LICENSE README.md |
| 15 |
git commit -m 'initial commit' |
| 16 |
git branch -m master |
| 17 |
|
| 18 |
# 1 |
| 19 |
git branch mybranch |
| 20 |
git checkout mybranch |
| 21 |
|
| 22 |
at 2018-02-19T18:10:06-05:00 |
| 23 |
mkdir pkg |
| 24 |
echo 'package p // pkg/p.go' |
| 25 |
cp stdout pkg/p.go |
| 26 |
git add pkg/p.go |
| 27 |
git commit -m 'add pkg/p.go' |
| 28 |
git tag v0.0.0 |
| 29 |
git tag v1.0.0 |
| 30 |
git tag v2.0.0 |
| 31 |
git tag mytag |
| 32 |
|
| 33 |
git branch v1 |
| 34 |
git branch v2 |
| 35 |
git checkout v2 |
| 36 |
|
| 37 |
# 2 |
| 38 |
at 2018-02-19T18:14:23-05:00 |
| 39 |
mkdir v2 |
| 40 |
echo 'module "github.com/rsc/vgotest1/v2" // root go.mod' |
| 41 |
cp stdout go.mod |
| 42 |
git add go.mod |
| 43 |
git commit -m 'go.mod v2' |
| 44 |
git tag v2.0.1 |
| 45 |
|
| 46 |
# 3 |
| 47 |
at 2018-02-19T18:15:11-05:00 |
| 48 |
mkdir submod/pkg |
| 49 |
echo 'package p // submod/pkg/p.go' |
| 50 |
cp stdout submod/pkg/p.go |
| 51 |
git add submod/pkg/p.go |
| 52 |
git commit -m 'submod/pkg/p.go' |
| 53 |
git tag v2.0.2 |
| 54 |
|
| 55 |
# 4 |
| 56 |
at 2018-02-19T18:16:04-05:00 |
| 57 |
echo 'module "github.com/rsc/vgotest" // v2/go.mod' |
| 58 |
cp stdout v2/go.mod |
| 59 |
git add v2/go.mod |
| 60 |
git commit -m 'v2/go.mod: bad go.mod (no version)' |
| 61 |
git tag v2.0.3 |
| 62 |
|
| 63 |
# 5 |
| 64 |
at 2018-02-19T19:03:38-05:00 |
| 65 |
env GIT_AUTHOR_DATE=2018-02-19T18:16:38-05:00 |
| 66 |
echo 'module "github.com/rsc/vgotest1/v2" // v2/go.mod' |
| 67 |
cp stdout v2/go.mod |
| 68 |
git add v2/go.mod |
| 69 |
git commit -m 'v2/go.mod: fix' |
| 70 |
git tag v2.0.4 |
| 71 |
|
| 72 |
# 6 |
| 73 |
at 2018-02-19T19:03:59-05:00 |
| 74 |
env GIT_AUTHOR_DATE=2018-02-19T18:17:02-05:00 |
| 75 |
echo 'module "github.com/rsc/vgotest1" // root go.mod' |
| 76 |
cp stdout go.mod |
| 77 |
git add go.mod |
| 78 |
git commit -m 'go.mod: drop v2' |
| 79 |
git tag v2.0.5 |
| 80 |
|
| 81 |
git checkout v1 |
| 82 |
|
| 83 |
# 7 |
| 84 |
at 2018-02-19T18:10:28-05:00 |
| 85 |
echo 'module "github.com/rsc/vgotest1" // root go.mod' |
| 86 |
cp stdout go.mod |
| 87 |
git add go.mod |
| 88 |
git commit -m 'go.mod' |
| 89 |
git tag v0.0.1 |
| 90 |
git tag v1.0.1 |
| 91 |
|
| 92 |
# 8 |
| 93 |
at 2018-02-19T18:11:28-05:00 |
| 94 |
mkdir submod/pkg |
| 95 |
echo 'package pkg // submod/pkg/p.go' |
| 96 |
cp stdout submod/pkg/p.go |
| 97 |
git add submod |
| 98 |
git commit -m 'submod/pkg/p.go' |
| 99 |
git tag v1.0.2 |
| 100 |
|
| 101 |
# 9 |
| 102 |
at 2018-02-19T18:12:07-05:00 |
| 103 |
echo 'module "github.com/vgotest1/submod" // submod/go.mod' |
| 104 |
cp stdout submod/go.mod |
| 105 |
git add submod/go.mod |
| 106 |
git commit -m 'submod/go.mod' |
| 107 |
git tag v1.0.3 |
| 108 |
git tag submod/v1.0.4 |
| 109 |
|
| 110 |
# 10 |
| 111 |
at 2018-02-19T18:12:59-05:00 |
| 112 |
git apply ../0001-submod-go.mod-add-require-vgotest1-v1.1.0.patch |
| 113 |
git commit -a -m 'submod/go.mod: add require vgotest1 v1.1.0' |
| 114 |
git tag submod/v1.0.5 |
| 115 |
|
| 116 |
# 11 |
| 117 |
at 2018-02-19T18:13:36-05:00 |
| 118 |
git apply ../0002-go.mod-add-require-submod-v1.0.5.patch |
| 119 |
git commit -a -m 'go.mod: add require submod v1.0.5' |
| 120 |
git tag v1.1.0 |
| 121 |
|
| 122 |
git checkout master |
| 123 |
|
| 124 |
# 12 |
| 125 |
at 2018-02-19T17:23:01-05:00 |
| 126 |
mkdir pkg |
| 127 |
echo 'package pkg' |
| 128 |
cp stdout pkg/p.go |
| 129 |
git add pkg/p.go |
| 130 |
git commit -m 'pkg: add' |
| 131 |
|
| 132 |
# 13 |
| 133 |
at 2018-02-19T17:30:23-05:00 |
| 134 |
env GIT_AUTHOR_DATE=2018-02-19T17:24:48-05:00 |
| 135 |
echo 'module "github.com/vgotest1/v2"' |
| 136 |
cp stdout go.mod |
| 137 |
git add go.mod |
| 138 |
git commit -m 'add go.mod' |
| 139 |
|
| 140 |
# 14 |
| 141 |
at 2018-02-19T17:30:45-05:00 |
| 142 |
echo 'module "github.com/vgotest1"' |
| 143 |
cp stdout go.mod |
| 144 |
git add go.mod |
| 145 |
git commit -m 'bad mod path' |
| 146 |
|
| 147 |
# 15 |
| 148 |
at 2018-02-19T17:31:34-05:00 |
| 149 |
mkdir v2 |
| 150 |
echo 'module "github.com/vgotest1/v2"' |
| 151 |
cp stdout v2/go.mod |
| 152 |
git add v2/go.mod |
| 153 |
git commit -m 'add v2/go.mod' |
| 154 |
|
| 155 |
# 16 |
| 156 |
at 2018-02-19T17:32:37-05:00 |
| 157 |
echo 'module "github.com/vgotest1/v2"' |
| 158 |
cp stdout go.mod |
| 159 |
git add go.mod |
| 160 |
git commit -m 'say v2 in root go.mod' |
| 161 |
|
| 162 |
# 17 |
| 163 |
at 2018-02-19T17:51:24-05:00 |
| 164 |
# README.md at this commit lacked a trailing newline, so 'git apply' can't |
| 165 |
# seem to apply it correctly as a patch. Instead, we use 'unquote' to write |
| 166 |
# the exact contents. |
| 167 |
unquote 'This is a test repo for versioned go.\nThere''s nothing useful here.\n\n v0.0.0 - has pkg/p.go\n v0.0.1 - has go.mod\n \n v1.0.0 - has pkg/p.go\n v1.0.1 - has go.mod\n v1.0.2 - has submod/pkg/p.go\n v1.0.3 - has submod/go.mod\n submod/v1.0.4 - same\n submod/v1.0.5 - add requirement on v1.1.0\n v1.1.0 - add requirement on submod/v1.0.5\n \n v2.0.0 - has pkg/p.go\n v2.0.1 - has go.mod with v2 module path\n v2.0.2 - has go.mod with v1 (no version) module path\n v2.0.3 - has v2/go.mod with v2 module path\n v2.0.5 - has go.mod AND v2/go.mod with v2 module path\n ' |
| 168 |
cp stdout README.md |
| 169 |
mkdir v2/pkg |
| 170 |
echo 'package q' |
| 171 |
cp stdout v2/pkg/q.go |
| 172 |
git add README.md v2/pkg/q.go |
| 173 |
git commit -m 'add q' |
| 174 |
git tag v2.0.6 |
| 175 |
|
| 176 |
cd .. |
| 177 |
|
| 178 |
hg init |
| 179 |
hg convert ./git . |
| 180 |
rm ./git |
| 181 |
|
| 182 |
# Note: commit #18 is an 'update tags' commit automatically generated by 'hg |
| 183 |
# convert'. We have no control over its timestamp, so it and its descendent |
| 184 |
# commit #19 both end up with unpredictable commit hashes. |
| 185 |
# |
| 186 |
# Fortunately, these commits don't seem to matter for the purpose of reproducing |
| 187 |
# the final branches and heads from the original copy of this repo. |
| 188 |
|
| 189 |
# 19 |
| 190 |
hg update -C -r 18 |
| 191 |
hg tag --user 'Russ Cox <[email protected]>' --date '2018-07-18T21:24:45-04:00' -m 'Removed tag v2.0.0' --remove v2.0.0 |
| 192 |
|
| 193 |
# 20 |
| 194 |
hg branch default |
| 195 |
hg update -C -r 1 |
| 196 |
echo 'v2' |
| 197 |
cp stdout v2 |
| 198 |
hg add v2 |
| 199 |
hg commit --user 'Russ Cox <[email protected]>' --date '2018-07-18T21:25:08-04:00' -m 'v2.0.0' |
| 200 |
|
| 201 |
# 21 |
| 202 |
hg tag --user 'Russ Cox <[email protected]>' --date '2018-07-18T21:25:13-04:00' -r f0ababb31f75 -m 'Added tag v2.0.0 for changeset f0ababb31f75' v2.0.0 |
| 203 |
|
| 204 |
# 22 |
| 205 |
hg tag --user 'Russ Cox <[email protected]>' --date '2018-07-18T21:26:02-04:00' -m 'Removed tag v2.0.0' --remove v2.0.0 |
| 206 |
|
| 207 |
# 23 |
| 208 |
hg update -C -r 1 |
| 209 |
echo 'v2' |
| 210 |
cp stdout v2 |
| 211 |
hg add v2 |
| 212 |
hg commit --user 'Russ Cox <[email protected]>' --date '2018-07-19T01:21:27+00:00' -m 'v2' |
| 213 |
|
| 214 |
# 24 |
| 215 |
hg tag --user 'Russ Cox <[email protected]>' --date '2018-07-18T21:26:33-04:00' -m 'Added tag v2.0.0 for changeset 814fce58e83a' -r 814fce58e83a v2.0.0 |
| 216 |
|
| 217 |
hg book --delete v1 |
| 218 |
hg book --delete v2 |
| 219 |
hg book --force -r 16 master |
| 220 |
|
| 221 |
hg log -G --debug |
| 222 |
|
| 223 |
hg tags |
| 224 |
cmp stdout .hg-tags |
| 225 |
hg branches |
| 226 |
cmp stdout .hg-branches |
| 227 |
hg bookmarks |
| 228 |
cmp stdout .hg-bookmarks |
| 229 |
|
| 230 |
-- .hg-tags -- |
| 231 |
tip 24:645b06ca536d |
| 232 |
v2.0.0 23:814fce58e83a |
| 233 |
v2.0.6 17:3d4b89a2d059 |
| 234 |
v1.1.0 11:92c7eb888b4f |
| 235 |
submod/v1.0.5 10:f3f560a6065c |
| 236 |
v1.0.3 9:4e58084d459a |
| 237 |
submod/v1.0.4 9:4e58084d459a |
| 238 |
v1.0.2 8:3ccdce3897f9 |
| 239 |
v1.0.1 7:7890ea771ced |
| 240 |
v0.0.1 7:7890ea771ced |
| 241 |
v2.0.5 6:879ea98f7743 |
| 242 |
v2.0.4 5:bf6388016230 |
| 243 |
v2.0.3 4:a9ad6d1d14eb |
| 244 |
v2.0.2 3:de3663002f0f |
| 245 |
v2.0.1 2:f1fc0f22021b |
| 246 |
v1.0.0 1:e125018e286a |
| 247 |
v0.0.0 1:e125018e286a |
| 248 |
mytag 1:e125018e286a |
| 249 |
-- .hg-branches -- |
| 250 |
default 24:645b06ca536d |
| 251 |
-- .hg-bookmarks -- |
| 252 |
master 16:577bde103b24 |
| 253 |
mybranch 1:e125018e286a |
| 254 |
-- git/LICENSE -- |
| 255 |
Copyright (c) 2009 The Go Authors. All rights reserved. |
| 256 |
|
| 257 |
Redistribution and use in source and binary forms, with or without |
| 258 |
modification, are permitted provided that the following conditions are |
| 259 |
met: |
| 260 |
|
| 261 |
* Redistributions of source code must retain the above copyright |
| 262 |
notice, this list of conditions and the following disclaimer. |
| 263 |
* Redistributions in binary form must reproduce the above |
| 264 |
copyright notice, this list of conditions and the following disclaimer |
| 265 |
in the documentation and/or other materials provided with the |
| 266 |
distribution. |
| 267 |
* Neither the name of Google Inc. nor the names of its |
| 268 |
contributors may be used to endorse or promote products derived from |
| 269 |
this software without specific prior written permission. |
| 270 |
|
| 271 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 272 |
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 273 |
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 274 |
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 275 |
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 276 |
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 277 |
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 278 |
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 279 |
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 280 |
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 281 |
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 282 |
-- git/README.md -- |
| 283 |
This is a test repo for versioned go. |
| 284 |
There's nothing useful here. |
| 285 |
-- 0001-submod-go.mod-add-require-vgotest1-v1.1.0.patch -- |
| 286 |
From 70fd92eaa4dacf82548d0c6099f5b853ae2c1fc8 Mon Sep 17 00:00:00 2001 |
| 287 |
From: Russ Cox <[email protected]> |
| 288 |
Date: Mon, 19 Feb 2018 18:12:59 -0500 |
| 289 |
Subject: [PATCH] submod/go.mod: add require vgotest1 v1.1.0 |
| 290 |
|
| 291 |
--- |
| 292 |
submod/go.mod | 1 + |
| 293 |
1 file changed, 1 insertion(+) |
| 294 |
|
| 295 |
diff --git a/submod/go.mod b/submod/go.mod |
| 296 |
index 7b18d93..c88de0f 100644 |
| 297 |
--- a/submod/go.mod |
| 298 |
+++ b/submod/go.mod |
| 299 |
@@ -1 +1,2 @@ |
| 300 |
module "github.com/vgotest1/submod" // submod/go.mod |
| 301 |
+require "github.com/vgotest1" v1.1.0 |
| 302 |
-- |
| 303 |
2.36.1.838.g23b219f8e3 |
| 304 |
-- 0002-go.mod-add-require-submod-v1.0.5.patch -- |
| 305 |
From b769f2de407a4db81af9c5de0a06016d60d2ea09 Mon Sep 17 00:00:00 2001 |
| 306 |
From: Russ Cox <[email protected]> |
| 307 |
Date: Mon, 19 Feb 2018 18:13:36 -0500 |
| 308 |
Subject: [PATCH] go.mod: add require submod v1.0.5 |
| 309 |
|
| 310 |
--- |
| 311 |
go.mod | 1 + |
| 312 |
1 file changed, 1 insertion(+) |
| 313 |
|
| 314 |
diff --git a/go.mod b/go.mod |
| 315 |
index ac7a6d7..6118671 100644 |
| 316 |
--- a/go.mod |
| 317 |
+++ b/go.mod |
| 318 |
@@ -1 +1,2 @@ |
| 319 |
module "github.com/rsc/vgotest1" // root go.mod |
| 320 |
+require "github.com/rsc/vgotest1/submod" v1.0.5 |
| 321 |
-- |
| 322 |
2.36.1.838.g23b219f8e3 |