Mercurial > hg
comparison tests/test-dirstate.t @ 49164:a932cad26d37
branching: merge stable into default
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Wed, 04 May 2022 18:17:44 +0200 |
parents | 42d2b31cee0b 682b0ac92c0b |
children | 13dfad0f9f7a |
comparison
equal
deleted
inserted
replaced
49147:10b9f11daf15 | 49164:a932cad26d37 |
---|---|
117 $ hg st -c | 117 $ hg st -c |
118 C hgext/zeroconf.py | 118 C hgext/zeroconf.py |
119 C hgext3rd/__init__.py | 119 C hgext3rd/__init__.py |
120 | 120 |
121 $ cd .. | 121 $ cd .. |
122 | |
123 Check that the old dirstate data file is removed correctly and the new one is | |
124 valid. | |
125 | |
126 $ dirstate_data_files () { | |
127 > find .hg -maxdepth 1 -name "dirstate.*" | |
128 > } | |
129 | |
130 $ find_dirstate_uuid () { | |
131 > hg debugstate --docket | grep uuid | sed 's/.*uuid: \(.*\)/\1/' | |
132 > } | |
133 | |
134 $ dirstate_uuid_has_not_changed () { | |
135 > # Non-Rust always rewrites the whole dirstate | |
136 > if [ $# -eq 1 ] || ([ -n "$HGMODULEPOLICY" ] && [ -z "${HGMODULEPOLICY##*rust*}" ]) || [ -n "$RHG_INSTALLED_AS_HG" ]; then | |
137 > test $current_uid = $(find_dirstate_uuid) | |
138 > else | |
139 > echo "not testing because using Python implementation" | |
140 > fi | |
141 > } | |
142 | |
143 $ cd .. | |
144 $ hg init append-mostly | |
145 $ cd append-mostly | |
146 $ mkdir dir dir2 | |
147 $ touch dir/a dir/b dir/c dir/d dir/e dir2/f | |
148 $ hg commit -Aqm initial | |
149 $ hg st | |
150 $ dirstate_data_files | wc -l | |
151 *1 (re) | |
152 $ current_uid=$(find_dirstate_uuid) | |
153 | |
154 Nothing changes here | |
155 | |
156 $ hg st | |
157 $ dirstate_data_files | wc -l | |
158 *1 (re) | |
159 $ dirstate_uuid_has_not_changed | |
160 not testing because using Python implementation (no-rust no-rhg !) | |
161 | |
162 Trigger an append with a small change | |
163 | |
164 $ echo "modified" > dir2/f | |
165 $ hg st | |
166 M dir2/f | |
167 $ dirstate_data_files | wc -l | |
168 *1 (re) | |
169 $ dirstate_uuid_has_not_changed | |
170 not testing because using Python implementation (no-rust no-rhg !) | |
171 | |
172 Unused bytes counter is non-0 when appending | |
173 $ touch file | |
174 $ hg add file | |
175 $ current_uid=$(find_dirstate_uuid) | |
176 | |
177 Trigger a rust/rhg run which updates the unused bytes value | |
178 $ hg st | |
179 M dir2/f | |
180 A file | |
181 $ dirstate_data_files | wc -l | |
182 *1 (re) | |
183 $ dirstate_uuid_has_not_changed | |
184 not testing because using Python implementation (no-rust no-rhg !) | |
185 | |
186 $ hg debugstate --docket | grep unused | |
187 number of unused bytes: 0 (no-rust no-rhg !) | |
188 number of unused bytes: [1-9]\d* (re) (rhg no-rust !) | |
189 number of unused bytes: [1-9]\d* (re) (rust no-rhg !) | |
190 number of unused bytes: [1-9]\d* (re) (rust rhg !) | |
191 | |
192 Delete most of the dirstate to trigger a non-append | |
193 $ hg rm dir/a dir/b dir/c dir/d | |
194 $ dirstate_data_files | wc -l | |
195 *1 (re) | |
196 $ dirstate_uuid_has_not_changed also-if-python | |
197 [1] | |
198 | |
199 Check that unused bytes counter is reset when creating a new docket | |
200 | |
201 $ hg debugstate --docket | grep unused | |
202 number of unused bytes: 0 | |
203 | |
122 #endif | 204 #endif |
205 | |
206 $ cd .. |