As Free Radical and Clive says the best way to implement a revisioning system is creating a custom entity. But if you can't create a custom entity and you have to use your own table, I answer here what I have done.
So, you have your
table and you have to create a
table_revision with the same fields and one mor field called
hook_node_update you can control when a node is updated, even when a node is revisioned.
So in the
$node argument of the
hook_node_update you have three
vid (revision ID):
$node->vid is the new
$node->original->vid is the previous
vid that the node had, and the
$node->old_vid is the
vid of the node where you revert.
$node->old_vid is the same value than
$node->original->vid means that the node is edited and not reverted, and if it is not the same value, it means that the node is reverted to a previous revision.
If the node is edited, you have to insert the new values in the
table_revision with the '$node->vid
revision ID. But if the node is reverted, you have to get the old values from thetable_revision
withrevision_id = $node->old_vid
and then copy this values in thetable