| 1 |
====================================================== |
| 2 |
Test operation on repository with an inlined changelog |
| 3 |
====================================================== |
| 4 |
|
| 5 |
Inlined revlog has been a bag of complexity for a long time and the combination |
| 6 |
with special transaction logic on the changelog was a long source of bugs |
| 7 |
poorly covered by the test suites. |
| 8 |
|
| 9 |
We stopped doing any usage of inlined-revlog for changelog in a93e52f0b6ff, |
| 10 |
upgrading legacy inlined version as soon as possible when we see them. However |
| 11 |
this Mercurial does not produce such inlined-changelog that case is very poorly |
| 12 |
covered in the test suites. This test file aims at covering these cases. |
| 13 |
|
| 14 |
Double checking test data |
| 15 |
========================= |
| 16 |
|
| 17 |
We should have a repository around |
| 18 |
|
| 19 |
$ mkdir sanity-check |
| 20 |
$ cd sanity-check |
| 21 |
$ cat "$TESTDIR/bundles/inlined-changelog.tar" | tar xf - |
| 22 |
|
| 23 |
$ cd inlined-changelog |
| 24 |
$ hg root |
| 25 |
$TESTTMP/sanity-check/inlined-changelog |
| 26 |
|
| 27 |
The repository should not be corrupted initially |
| 28 |
|
| 29 |
$ hg verify |
| 30 |
checking changesets |
| 31 |
checking manifests |
| 32 |
crosschecking files in changesets and manifests |
| 33 |
checking files |
| 34 |
checking dirstate |
| 35 |
checked 1 changesets with 1 changes to 1 files |
| 36 |
|
| 37 |
The changelog of that repository MUST be inlined |
| 38 |
|
| 39 |
$ hg debugrevlog -c | grep -E '^flags\b' |
| 40 |
flags : inline |
| 41 |
|
| 42 |
Touching that repository MUST split that inlined changelog |
| 43 |
|
| 44 |
$ hg branch foo --quiet |
| 45 |
$ hg commit -m foo --quiet |
| 46 |
$ hg debugrevlog -c | grep -E '^flags\b' |
| 47 |
flags : (none) |
| 48 |
|
| 49 |
$ cd ../.. |
| 50 |
|
| 51 |
Test doing a simple commit |
| 52 |
========================== |
| 53 |
|
| 54 |
Simple commit |
| 55 |
------------- |
| 56 |
|
| 57 |
$ mkdir simple-commit |
| 58 |
$ cd simple-commit |
| 59 |
$ cat "$TESTDIR/bundles/inlined-changelog.tar" | tar xf - |
| 60 |
$ cd inlined-changelog |
| 61 |
$ hg up --quiet |
| 62 |
$ hg log -GT '[{rev}] {desc}\n' |
| 63 |
@ [0] first commit |
| 64 |
|
| 65 |
$ echo b > b |
| 66 |
$ hg add b |
| 67 |
$ hg commit -m "second changeset" |
| 68 |
$ hg verify |
| 69 |
checking changesets |
| 70 |
checking manifests |
| 71 |
crosschecking files in changesets and manifests |
| 72 |
checking files |
| 73 |
checking dirstate |
| 74 |
checked 2 changesets with 2 changes to 2 files |
| 75 |
$ hg log -GT '[{rev}] {desc}\n' |
| 76 |
@ [1] second changeset |
| 77 |
| |
| 78 |
o [0] first commit |
| 79 |
|
| 80 |
$ cd ../.. |
| 81 |
|
| 82 |
Simple commit with a pretxn hook configured |
| 83 |
------------------------------------------- |
| 84 |
|
| 85 |
Before 6.7.3 this used to delete the changelog index |
| 86 |
|
| 87 |
$ mkdir pretxnclose-commit |
| 88 |
$ cd pretxnclose-commit |
| 89 |
$ cat "$TESTDIR/bundles/inlined-changelog.tar" | tar xf - |
| 90 |
$ cat >> inlined-changelog/.hg/hgrc <<EOF |
| 91 |
> [hooks] |
| 92 |
> pretxnclose=hg log -r tip -T "pre-txn tip rev: {rev}\n" |
| 93 |
> EOF |
| 94 |
$ cd inlined-changelog |
| 95 |
$ hg up --quiet |
| 96 |
$ hg log -GT '[{rev}] {desc}\n' |
| 97 |
@ [0] first commit |
| 98 |
|
| 99 |
$ echo b > b |
| 100 |
$ hg add b |
| 101 |
$ hg commit -m "second changeset" |
| 102 |
pre-txn tip rev: 1 |
| 103 |
$ hg verify |
| 104 |
checking changesets |
| 105 |
checking manifests |
| 106 |
crosschecking files in changesets and manifests |
| 107 |
checking files |
| 108 |
checking dirstate |
| 109 |
checked 2 changesets with 2 changes to 2 files |
| 110 |
$ hg log -GT '[{rev}] {desc}\n' |
| 111 |
@ [1] second changeset |
| 112 |
| |
| 113 |
o [0] first commit |
| 114 |
|
| 115 |
$ cd ../.. |
| 116 |
|
| 117 |
Test pushing to a repository with a repository revlog |
| 118 |
===================================================== |
| 119 |
|
| 120 |
Simple local push |
| 121 |
----------------- |
| 122 |
|
| 123 |
$ mkdir simple-local-push |
| 124 |
$ cd simple-local-push |
| 125 |
$ cat "$TESTDIR/bundles/inlined-changelog.tar" | tar xf - |
| 126 |
$ hg log -R inlined-changelog -T '[{rev}] {desc}\n' |
| 127 |
[0] first commit |
| 128 |
|
| 129 |
$ hg clone --pull inlined-changelog client |
| 130 |
requesting all changes |
| 131 |
adding changesets |
| 132 |
adding manifests |
| 133 |
adding file changes |
| 134 |
added 1 changesets with 1 changes to 1 files |
| 135 |
new changesets 827f11bfd362 |
| 136 |
updating to branch default |
| 137 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 138 |
$ cd client |
| 139 |
$ echo b > b |
| 140 |
$ hg add b |
| 141 |
$ hg commit -m "second changeset" |
| 142 |
$ hg push |
| 143 |
pushing to $TESTTMP/*/inlined-changelog (glob) |
| 144 |
searching for changes |
| 145 |
adding changesets |
| 146 |
adding manifests |
| 147 |
adding file changes |
| 148 |
added 1 changesets with 1 changes to 1 files |
| 149 |
$ cd .. |
| 150 |
|
| 151 |
$ hg verify -R inlined-changelog |
| 152 |
checking changesets |
| 153 |
checking manifests |
| 154 |
crosschecking files in changesets and manifests |
| 155 |
checking files |
| 156 |
checking dirstate |
| 157 |
checked 2 changesets with 2 changes to 2 files |
| 158 |
$ hg log -R inlined-changelog -T '[{rev}] {desc}\n' |
| 159 |
[1] second changeset |
| 160 |
[0] first commit |
| 161 |
$ cd .. |
| 162 |
|
| 163 |
Simple local push with a pretxnchangegroup hook |
| 164 |
----------------------------------------------- |
| 165 |
|
| 166 |
Before 6.7.3 this used to delete the server changelog |
| 167 |
|
| 168 |
$ mkdir pretxnchangegroup-local-push |
| 169 |
$ cd pretxnchangegroup-local-push |
| 170 |
$ cat "$TESTDIR/bundles/inlined-changelog.tar" | tar xf - |
| 171 |
$ cat >> inlined-changelog/.hg/hgrc <<EOF |
| 172 |
> [hooks] |
| 173 |
> pretxnchangegroup=hg log -r tip -T "pre-txn tip rev: {rev}\n" |
| 174 |
> EOF |
| 175 |
$ hg log -R inlined-changelog -T '[{rev}] {desc}\n' |
| 176 |
[0] first commit |
| 177 |
|
| 178 |
$ hg clone --pull inlined-changelog client |
| 179 |
requesting all changes |
| 180 |
adding changesets |
| 181 |
adding manifests |
| 182 |
adding file changes |
| 183 |
added 1 changesets with 1 changes to 1 files |
| 184 |
new changesets 827f11bfd362 |
| 185 |
updating to branch default |
| 186 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 187 |
$ cd client |
| 188 |
$ echo b > b |
| 189 |
$ hg add b |
| 190 |
$ hg commit -m "second changeset" |
| 191 |
$ hg push |
| 192 |
pushing to $TESTTMP/*/inlined-changelog (glob) |
| 193 |
searching for changes |
| 194 |
adding changesets |
| 195 |
adding manifests |
| 196 |
adding file changes |
| 197 |
pre-txn tip rev: 1 |
| 198 |
added 1 changesets with 1 changes to 1 files |
| 199 |
$ cd .. |
| 200 |
|
| 201 |
$ hg verify -R inlined-changelog |
| 202 |
checking changesets |
| 203 |
checking manifests |
| 204 |
crosschecking files in changesets and manifests |
| 205 |
checking files |
| 206 |
checking dirstate |
| 207 |
checked 2 changesets with 2 changes to 2 files |
| 208 |
$ hg log -R inlined-changelog -T '[{rev}] {desc}\n' |
| 209 |
[1] second changeset |
| 210 |
[0] first commit |
| 211 |
$ cd .. |
| 212 |
|
| 213 |
Simple ssh push |
| 214 |
----------------- |
| 215 |
|
| 216 |
$ mkdir simple-ssh-push |
| 217 |
$ cd simple-ssh-push |
| 218 |
$ cat "$TESTDIR/bundles/inlined-changelog.tar" | tar xf - |
| 219 |
$ hg log -R inlined-changelog -T '[{rev}] {desc}\n' |
| 220 |
[0] first commit |
| 221 |
|
| 222 |
$ hg clone ssh://user@dummy/"`pwd`"/inlined-changelog client |
| 223 |
requesting all changes |
| 224 |
adding changesets |
| 225 |
adding manifests |
| 226 |
adding file changes |
| 227 |
added 1 changesets with 1 changes to 1 files |
| 228 |
new changesets 827f11bfd362 |
| 229 |
updating to branch default |
| 230 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 231 |
$ cd client |
| 232 |
$ echo b > b |
| 233 |
$ hg add b |
| 234 |
$ hg commit -m "second changeset" |
| 235 |
$ hg push |
| 236 |
pushing to ssh://user@dummy/$TESTTMP/simple-ssh-push/inlined-changelog |
| 237 |
searching for changes |
| 238 |
remote: adding changesets |
| 239 |
remote: adding manifests |
| 240 |
remote: adding file changes |
| 241 |
remote: added 1 changesets with 1 changes to 1 files |
| 242 |
$ cd .. |
| 243 |
|
| 244 |
$ hg verify -R inlined-changelog |
| 245 |
checking changesets |
| 246 |
checking manifests |
| 247 |
crosschecking files in changesets and manifests |
| 248 |
checking files |
| 249 |
checking dirstate |
| 250 |
checked 2 changesets with 2 changes to 2 files |
| 251 |
$ hg log -R inlined-changelog -T '[{rev}] {desc}\n' |
| 252 |
[1] second changeset |
| 253 |
[0] first commit |
| 254 |
$ cd .. |
| 255 |
|
| 256 |
Simple ssh push with a pretxnchangegroup hook |
| 257 |
----------------------------------------------- |
| 258 |
|
| 259 |
Before 6.7.3 this used to delete the server changelog |
| 260 |
|
| 261 |
$ mkdir pretxnchangegroup-ssh-push |
| 262 |
$ cd pretxnchangegroup-ssh-push |
| 263 |
$ cat "$TESTDIR/bundles/inlined-changelog.tar" | tar xf - |
| 264 |
$ cat >> inlined-changelog/.hg/hgrc <<EOF |
| 265 |
> [hooks] |
| 266 |
> pretxnchangegroup=hg log -r tip -T "pre-txn tip rev: {rev}\n" |
| 267 |
> EOF |
| 268 |
$ hg log -R inlined-changelog -T '[{rev}] {desc}\n' |
| 269 |
[0] first commit |
| 270 |
|
| 271 |
$ hg clone ssh://user@dummy/"`pwd`"/inlined-changelog client |
| 272 |
requesting all changes |
| 273 |
adding changesets |
| 274 |
adding manifests |
| 275 |
adding file changes |
| 276 |
added 1 changesets with 1 changes to 1 files |
| 277 |
new changesets 827f11bfd362 |
| 278 |
updating to branch default |
| 279 |
1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 280 |
$ cd client |
| 281 |
$ echo b > b |
| 282 |
$ hg add b |
| 283 |
$ hg commit -m "second changeset" |
| 284 |
$ hg push |
| 285 |
pushing to ssh://user@dummy/$TESTTMP/pretxnchangegroup-ssh-push/inlined-changelog |
| 286 |
searching for changes |
| 287 |
remote: adding changesets |
| 288 |
remote: adding manifests |
| 289 |
remote: adding file changes |
| 290 |
remote: pre-txn tip rev: 1 |
| 291 |
remote: added 1 changesets with 1 changes to 1 files |
| 292 |
$ cd .. |
| 293 |
|
| 294 |
$ hg verify -R inlined-changelog |
| 295 |
checking changesets |
| 296 |
checking manifests |
| 297 |
crosschecking files in changesets and manifests |
| 298 |
checking files |
| 299 |
checking dirstate |
| 300 |
checked 2 changesets with 2 changes to 2 files |
| 301 |
$ hg log -R inlined-changelog -T '[{rev}] {desc}\n' |
| 302 |
[1] second changeset |
| 303 |
[0] first commit |
| 304 |
$ cd .. |