Version control editor gutter markings not matching local changes diff

I’m developing a plugin that includes a version control interface, using a subclass of the AbstractVcs class via the com.intellij.vcs EP.

The problem is a sequence like the following:

  1. Update, to get a base file
  2. Edit the file, let’s say a change on line 10
  3. (Meanwhile, someone else commits a change on line 20 in that file)
  4. Update, which detects that there are potential conflicts between local and server changes
  5. Merge (with my MergeProvider) – just clicking the wand and finish merge

Now, if I look at diff from local changes, it shows what I want – what my ChangeProvider registers in its changes – namely, it shows I have one uncommitted change, on line 10. Both sides of the diff shows the other person’s change on line 20. In other words, it is comparing the merged version (“mine”) to the latest from the server (“theirs”). Seems perfectly reasonable to me.

However, the VCS markings in the editor gutter makes it look like there are uncommitted changes on both line 10 and line 20 – as if I had made the change on line 20. In other words, it is comparing the merged version (“mine”) to the base version. Which seems odd, because the base version should not be around after the merge was completed.

So, what I can’t figure out is where the editor gutter markings gets its “diff information” or information about the pre-edit state from, and what I need to do to make it match the diff. Either editor markings don’t come from the ChangeProvider (in which case, where do they come from?), or possibly they do come from the ChangeProvider, only there is some caching involved that I need to invalidate (if so, how?).