Mercurial > hg
diff tests/test-dirstate.t @ 49217:13dfad0f9f7a
branching: merge stable into default
author | Raphaël Gomès <rgomes@octobus.net> |
---|---|
date | Wed, 25 May 2022 13:28:24 +0200 |
parents | a932cad26d37 c29e79d11b01 |
children | 6b4ad07b4d69 |
line wrap: on
line diff
--- a/tests/test-dirstate.t Tue May 24 19:09:24 2022 +0400 +++ b/tests/test-dirstate.t Wed May 25 13:28:24 2022 +0200 @@ -131,6 +131,10 @@ > hg debugstate --docket | grep uuid | sed 's/.*uuid: \(.*\)/\1/' > } + $ find_dirstate_data_size () { + > hg debugstate --docket | grep 'size of dirstate data' | sed 's/.*size of dirstate data: \(.*\)/\1/' + > } + $ dirstate_uuid_has_not_changed () { > # Non-Rust always rewrites the whole dirstate > if [ $# -eq 1 ] || ([ -n "$HGMODULEPOLICY" ] && [ -z "${HGMODULEPOLICY##*rust*}" ]) || [ -n "$RHG_INSTALLED_AS_HG" ]; then @@ -161,13 +165,19 @@ Trigger an append with a small change - $ echo "modified" > dir2/f + $ current_data_size=$(find_dirstate_data_size) + $ rm dir2/f $ hg st - M dir2/f + ! dir2/f $ dirstate_data_files | wc -l *1 (re) $ dirstate_uuid_has_not_changed not testing because using Python implementation (no-rust no-rhg !) + $ new_data_size=$(find_dirstate_data_size) + $ [ "$current_data_size" -eq "$new_data_size" ]; echo $? + 0 (no-rust no-rhg !) + 1 (rust !) + 1 (no-rust rhg !) Unused bytes counter is non-0 when appending $ touch file @@ -176,8 +186,8 @@ Trigger a rust/rhg run which updates the unused bytes value $ hg st - M dir2/f A file + ! dir2/f $ dirstate_data_files | wc -l *1 (re) $ dirstate_uuid_has_not_changed