tests/test-debug-rebuild-dirstate.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Thu, 07 Mar 2024 10:55:22 +0100
changeset 51531 f85f23f1479b
parent 51181 dcaa2df1f688
permissions -rw-r--r--
branchcache: skip entries that are topological heads in the on disk file In the majority of cases, topological heads are also branch heads. We have efficient way to get the topological heads and efficient way to retrieve their branch information. So there is little value in putting them in the branch cache file explicitly. On the contrary, writing them explicitly tend to create very large cache file that are inefficient to read and update. So the branch cache v3 format is no longer including them. This changeset focus on the format aspect and have no focus on the performance aspect. We will cover that later.

#require rust

  $ cat >> $HGRCPATH << EOF
  > [format]
  > use-dirstate-v2=1
  > [storage]
  > dirstate-v2.slow-path=allow
  > EOF

  $ hg init t
  $ cd t

  $ for i in 1 2 3 4 5 6 7 8 9 10; do touch foobar$i; done
  $ hg add .
  adding foobar1
  adding foobar10
  adding foobar2
  adding foobar3
  adding foobar4
  adding foobar5
  adding foobar6
  adding foobar7
  adding foobar8
  adding foobar9
  $ hg commit -m "1"

Check that there's no space leak on debugrebuilddirstate

  $ f --size .hg/dirstate*
  .hg/dirstate: size=133
  .hg/dirstate.88698448: size=511
  $ hg debugrebuilddirstate
  $ f --size .hg/dirstate*
  .hg/dirstate: size=133
  .hg/dirstate.6b8ab34b: size=511
  $ hg debugrebuilddirstate
  $ f --size .hg/dirstate*
  .hg/dirstate: size=133
  .hg/dirstate.b875dfc5: size=511