tests/test-debug-rebuild-dirstate.t
author Pierre-Yves David <pierre-yves.david@octobus.net>
Tue, 09 Apr 2024 02:54:12 +0200
changeset 51577 b5d494f7d28a
parent 51181 dcaa2df1f688
permissions -rw-r--r--
push: rework the computation of fallbackheads to be correct The previous computation tried to be smart but ended up being wrong. This was caught by phase movement test while reworking the phase discovery logic to be faster. The previous logic was failing to catch case where the pushed set was not based on a common heads (i.e. when the discovery seemed to have "over discovered" content, outside the pushed set) In the following graph, `e` is a common head and we `hg push -r f`. We need to detect `c` as a fallback heads and we previous failed to do so:: e | d f |/ c | b | a The performance impact of the change seems minimal. On the most impacted repository at hand (mozilla-try), the slowdown seems mostly mixed in the overall noise `hg push` but seems to be in the hundred of milliseconds order of magnitude. When using rust, we seems to be a bit faster, probably because we leverage more accelaratd internals. I added a couple of performance related common for further investigation later on.

#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