tests/test-dirstate.t
branchstable
changeset 48866 c29e79d11b01
parent 48855 682b0ac92c0b
child 49238 13dfad0f9f7a
equal deleted inserted replaced
48865:477b5145e1a0 48866:c29e79d11b01
   130 
   130 
   131   $ find_dirstate_uuid () {
   131   $ find_dirstate_uuid () {
   132   >   hg debugstate --docket | grep uuid | sed 's/.*uuid: \(.*\)/\1/'
   132   >   hg debugstate --docket | grep uuid | sed 's/.*uuid: \(.*\)/\1/'
   133   > }
   133   > }
   134 
   134 
       
   135   $ find_dirstate_data_size () {
       
   136   >   hg debugstate --docket | grep 'size of dirstate data' | sed 's/.*size of dirstate data: \(.*\)/\1/'
       
   137   > }
       
   138 
   135   $ dirstate_uuid_has_not_changed () {
   139   $ dirstate_uuid_has_not_changed () {
   136   >   # Non-Rust always rewrites the whole dirstate
   140   >   # Non-Rust always rewrites the whole dirstate
   137   >   if [ $# -eq 1 ] || ([ -n "$HGMODULEPOLICY" ] && [ -z "${HGMODULEPOLICY##*rust*}" ]) || [ -n "$RHG_INSTALLED_AS_HG" ]; then
   141   >   if [ $# -eq 1 ] || ([ -n "$HGMODULEPOLICY" ] && [ -z "${HGMODULEPOLICY##*rust*}" ]) || [ -n "$RHG_INSTALLED_AS_HG" ]; then
   138   >     test $current_uid = $(find_dirstate_uuid)
   142   >     test $current_uid = $(find_dirstate_uuid)
   139   >   else
   143   >   else
   160   $ dirstate_uuid_has_not_changed
   164   $ dirstate_uuid_has_not_changed
   161   not testing because using Python implementation (no-rust no-rhg !)
   165   not testing because using Python implementation (no-rust no-rhg !)
   162 
   166 
   163 Trigger an append with a small change
   167 Trigger an append with a small change
   164 
   168 
   165   $ echo "modified" > dir2/f
   169   $ current_data_size=$(find_dirstate_data_size)
   166   $ hg st
   170   $ rm dir2/f
   167   M dir2/f
   171   $ hg st
       
   172   ! dir2/f
   168   $ dirstate_data_files | wc -l
   173   $ dirstate_data_files | wc -l
   169    *1 (re)
   174    *1 (re)
   170   $ dirstate_uuid_has_not_changed
   175   $ dirstate_uuid_has_not_changed
   171   not testing because using Python implementation (no-rust no-rhg !)
   176   not testing because using Python implementation (no-rust no-rhg !)
       
   177   $ new_data_size=$(find_dirstate_data_size)
       
   178   $ [ "$current_data_size" -eq "$new_data_size" ]; echo $?
       
   179   0 (no-rust no-rhg !)
       
   180   1 (rust !)
       
   181   1 (no-rust rhg !)
   172 
   182 
   173 Unused bytes counter is non-0 when appending
   183 Unused bytes counter is non-0 when appending
   174   $ touch file
   184   $ touch file
   175   $ hg add file
   185   $ hg add file
   176   $ current_uid=$(find_dirstate_uuid)
   186   $ current_uid=$(find_dirstate_uuid)
   177 
   187 
   178 Trigger a rust/rhg run which updates the unused bytes value
   188 Trigger a rust/rhg run which updates the unused bytes value
   179   $ hg st
   189   $ hg st
   180   M dir2/f
       
   181   A file
   190   A file
       
   191   ! dir2/f
   182   $ dirstate_data_files | wc -l
   192   $ dirstate_data_files | wc -l
   183    *1 (re)
   193    *1 (re)
   184   $ dirstate_uuid_has_not_changed
   194   $ dirstate_uuid_has_not_changed
   185   not testing because using Python implementation (no-rust no-rhg !)
   195   not testing because using Python implementation (no-rust no-rhg !)
   186 
   196