view tests/test-revert-unknown.t @ 50242:379a78001d8e stable

dirstate: set identity whenever we read the dirstate's v2 docket The docket can be loaded outside of a full read (for exemple when pre-fetching parents), so the current code would read/set the identity after loading the data, opening a race condition: A0: first process docket is read B0: other process appends new data to the dirstate (and changes the docket) A1: first process sets the identity (based on pre-B content, but with post-B identity) A1: first process loads the dirstatemap from the data file A1: first process does not detect the race and overwrites the update from B.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 01 Mar 2023 02:38:20 +0100
parents 55c6ebd11cb9
children
line wrap: on
line source

  $ hg init repo
  $ cd repo
  $ touch unknown

  $ touch a
  $ hg add a
  $ hg ci -m "1"

  $ touch b
  $ hg add b
  $ hg ci -m "2"

Should show unknown

  $ hg status
  ? unknown
  $ hg revert -r 0 --all
  removing b

Should show unknown and b removed

  $ hg status
  R b
  ? unknown

Should show a and unknown

  $ ls -A
  .hg
  a
  unknown