| 1 |
Test the "plain encoding" feature |
| 2 |
================================= |
| 3 |
|
| 4 |
This test the "plain" encoding for store where not much is actually encoding for filelog |
| 5 |
|
| 6 |
|
| 7 |
Setup |
| 8 |
----- |
| 9 |
|
| 10 |
|
| 11 |
$ cat >> $HGRCPATH << EOF |
| 12 |
> [format] |
| 13 |
> dotencode=no |
| 14 |
> exp-use-very-fragile-and-unsafe-plain-store-encoding=yes |
| 15 |
> EOF |
| 16 |
|
| 17 |
|
| 18 |
Create a plain-encoded repository |
| 19 |
|
| 20 |
$ hg init plain-encoded |
| 21 |
$ cd plain-encoded |
| 22 |
|
| 23 |
create some files and directory |
| 24 |
|
| 25 |
$ echo foo > foo |
| 26 |
$ mkdir toto |
| 27 |
$ echo bar > toto/bar |
| 28 |
$ mkdir toto/tutu |
| 29 |
$ echo fuz > toto/tutu/fuz |
| 30 |
$ mkdir rc.d |
| 31 |
$ echo baz >rc.d/baz |
| 32 |
$ hg addremove . |
| 33 |
adding foo |
| 34 |
adding rc.d/baz |
| 35 |
adding toto/bar |
| 36 |
adding toto/tutu/fuz |
| 37 |
$ hg commit -m 'initial commit' |
| 38 |
|
| 39 |
verify that basic operations works |
| 40 |
---------------------------------- |
| 41 |
|
| 42 |
$ hg export |
| 43 |
# HG changeset patch |
| 44 |
# User test |
| 45 |
# Date 0 0 |
| 46 |
# Thu Jan 01 00:00:00 1970 +0000 |
| 47 |
# Node ID b41a27cd96f26122b2178745540aa1f515bb02f3 |
| 48 |
# Parent 0000000000000000000000000000000000000000 |
| 49 |
initial commit |
| 50 |
|
| 51 |
diff -r 000000000000 -r b41a27cd96f2 foo |
| 52 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
| 53 |
+++ b/foo Thu Jan 01 00:00:00 1970 +0000 |
| 54 |
@@ -0,0 +1,1 @@ |
| 55 |
+foo |
| 56 |
diff -r 000000000000 -r b41a27cd96f2 rc.d/baz |
| 57 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
| 58 |
+++ b/rc.d/baz Thu Jan 01 00:00:00 1970 +0000 |
| 59 |
@@ -0,0 +1,1 @@ |
| 60 |
+baz |
| 61 |
diff -r 000000000000 -r b41a27cd96f2 toto/bar |
| 62 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
| 63 |
+++ b/toto/bar Thu Jan 01 00:00:00 1970 +0000 |
| 64 |
@@ -0,0 +1,1 @@ |
| 65 |
+bar |
| 66 |
diff -r 000000000000 -r b41a27cd96f2 toto/tutu/fuz |
| 67 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 |
| 68 |
+++ b/toto/tutu/fuz Thu Jan 01 00:00:00 1970 +0000 |
| 69 |
@@ -0,0 +1,1 @@ |
| 70 |
+fuz |
| 71 |
|
| 72 |
$ env RHG_ON_UNSUPPORTED=abort hg cat -r 0 rc.d/baz |
| 73 |
baz |
| 74 |
|
| 75 |
$ hg verify |
| 76 |
checking changesets |
| 77 |
checking manifests |
| 78 |
crosschecking files in changesets and manifests |
| 79 |
checking files |
| 80 |
checking dirstate |
| 81 |
checked 1 changesets with 4 changes to 4 files |
| 82 |
$ cd .. |
| 83 |
|
| 84 |
verify that thing listing the repository content works |
| 85 |
------------------------------------------------------ |
| 86 |
|
| 87 |
|
| 88 |
local clone |
| 89 |
|
| 90 |
$ hg clone plain-encoded local-cloned --debug --noupdate |
| 91 |
linked 10 files (no-rust !) |
| 92 |
linked 12 files (rust !) |
| 93 |
updating the branch cache |
| 94 |
$ hg verify -R local-cloned |
| 95 |
checking changesets |
| 96 |
checking manifests |
| 97 |
crosschecking files in changesets and manifests |
| 98 |
checking files |
| 99 |
checking dirstate |
| 100 |
checked 1 changesets with 4 changes to 4 files |
| 101 |
$ hg update -R local-cloned |
| 102 |
4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 103 |
|
| 104 |
stream clone |
| 105 |
|
| 106 |
$ hg clone --stream ssh://user@dummy/plain-encoded stream-cloned --noupdate |
| 107 |
streaming all changes |
| 108 |
10 files to transfer, * (glob) (no-rust !) |
| 109 |
stream-cloned 10 files / * (glob) (no-rust !) |
| 110 |
12 files to transfer, * (glob) (rust !) |
| 111 |
stream-cloned 12 files / * (glob) (rust !) |
| 112 |
$ hg verify -R stream-cloned |
| 113 |
checking changesets |
| 114 |
checking manifests |
| 115 |
crosschecking files in changesets and manifests |
| 116 |
checking files |
| 117 |
checking dirstate |
| 118 |
checked 1 changesets with 4 changes to 4 files |
| 119 |
$ hg update -R stream-cloned |
| 120 |
4 files updated, 0 files merged, 0 files removed, 0 files unresolved |
| 121 |
|
| 122 |
Verify store layout |
| 123 |
------------------- |
| 124 |
|
| 125 |
$ cd plain-encoded |
| 126 |
|
| 127 |
$ f --recurse .hg/store/data |
| 128 |
.hg/store/data: directory with 3 files |
| 129 |
.hg/store/data/foo.i: |
| 130 |
.hg/store/data/rc.d_: directory with 1 files |
| 131 |
.hg/store/data/rc.d_/baz.i: |
| 132 |
.hg/store/data/toto_: directory with 2 files |
| 133 |
.hg/store/data/toto_/bar.i: |
| 134 |
.hg/store/data/toto_/tutu_: directory with 1 files |
| 135 |
.hg/store/data/toto_/tutu_/fuz.i: |
| 136 |
|
| 137 |
Downgrade/Upgrade |
| 138 |
----------------- |
| 139 |
|
| 140 |
downgrade |
| 141 |
|
| 142 |
$ hg debugformat fragile-plain-encode dotencode fncache |
| 143 |
format-variant repo |
| 144 |
fncache: yes |
| 145 |
dotencode: no |
| 146 |
fragile-plain-encode: yes |
| 147 |
$ hg debugupgraderepo --quiet --run \ |
| 148 |
> --config format.dotencode=yes \ |
| 149 |
> --config format.exp-use-very-fragile-and-unsafe-plain-store-encoding=no |
| 150 |
upgrade will perform the following actions: |
| 151 |
|
| 152 |
requirements |
| 153 |
preserved: * (glob) |
| 154 |
removed: exp-very-fragile-and-unsafe-plain-store-encoding |
| 155 |
added: dotencode |
| 156 |
|
| 157 |
processed revlogs: |
| 158 |
- all-filelogs |
| 159 |
|
| 160 |
$ hg debugformat fragile-plain-encode dotencode fncache |
| 161 |
format-variant repo |
| 162 |
fncache: yes |
| 163 |
dotencode: yes |
| 164 |
fragile-plain-encode: no |
| 165 |
$ hg verify |
| 166 |
checking changesets |
| 167 |
checking manifests |
| 168 |
crosschecking files in changesets and manifests |
| 169 |
checking files |
| 170 |
checking dirstate |
| 171 |
checked 1 changesets with 4 changes to 4 files |
| 172 |
|
| 173 |
upgrade |
| 174 |
|
| 175 |
$ hg debugformat fragile-plain-encode dotencode fncache |
| 176 |
format-variant repo |
| 177 |
fncache: yes |
| 178 |
dotencode: yes |
| 179 |
fragile-plain-encode: no |
| 180 |
$ hg debugupgraderepo --quiet --run \ |
| 181 |
> --config format.dotencode=no \ |
| 182 |
> --config format.exp-use-very-fragile-and-unsafe-plain-store-encoding=yes |
| 183 |
upgrade will perform the following actions: |
| 184 |
|
| 185 |
requirements |
| 186 |
preserved: * (glob) |
| 187 |
removed: dotencode |
| 188 |
added: exp-very-fragile-and-unsafe-plain-store-encoding |
| 189 |
|
| 190 |
processed revlogs: |
| 191 |
- all-filelogs |
| 192 |
|
| 193 |
$ hg debugformat fragile-plain-encode dotencode fncache |
| 194 |
format-variant repo |
| 195 |
fncache: yes |
| 196 |
dotencode: no |
| 197 |
fragile-plain-encode: yes |
| 198 |
$ hg verify |
| 199 |
checking changesets |
| 200 |
checking manifests |
| 201 |
crosschecking files in changesets and manifests |
| 202 |
checking files |
| 203 |
checking dirstate |
| 204 |
checked 1 changesets with 4 changes to 4 files |