consider the case when branches were deleted / update lastRev after changed added to the database (avoid adding duplicated)