I created a custom entity in my module and I can edit and save it just like any other entity in core. I also want to save revisions for this entity but I couldn't find any help so far. I tried this (from node module) but it doesn't work:
$entity = $this->getEntity();
$entity->new_revision = true;
$entity->save();
I have the revisions tables declared in @ContentEntityType
annotation, I have the revision_id
field declared in baseFieldDefinitions()
but I don't know how to actually save a new revision.