code: private void removeVersionHistory(NodeData mixVersionableNode) throws RepositoryException,
        ConstraintViolationException, VersionException
     {
        try
        {
           PropertyData vhpd =
              (PropertyData)dataConsumer.getItemData(mixVersionableNode, new QPathEntry(Constants.JCR_VERSIONHISTORY, 1),
                 ItemType.PROPERTY);
  
           String vhID = ValueDataUtil.getString(vhpd.getValues().get(0));
           VersionHistoryRemover historyRemover =
              new VersionHistoryRemover(vhID, dataConsumer, nodeTypeDataManager, repository, currentWorkspaceName, null,
                 ancestorToSave, changesLog, accessManager, userState);
           historyRemover.remove();
        }
        catch (IllegalStateException e)
        {
           throw new RepositoryException(e);
        }
     }
docs: Remove version history of versionable node.
  
  @param mixVersionableNode - node
  @throws RepositoryException
  @throws ConstraintViolationException
  @throws VersionException