code: protected void createVersionHistory(ImportNodeData nodeData) throws RepositoryException
     {
        // Generate new VersionHistoryIdentifier and BaseVersionIdentifier
        // if uuid changed after UC
        boolean newVersionHistory = nodeData.isNewIdentifer() || !nodeData.isContainsVersionhistory();
        if (newVersionHistory)
        {
           nodeData.setVersionHistoryIdentifier(IdGenerator.generate());
           nodeData.setBaseVersionIdentifier(IdGenerator.generate());
        }
  
        PlainChangesLogImpl changes = new PlainChangesLogImpl();
        // using VH helper as for one new VH, all changes in changes log
        new VersionHistoryDataHelper(nodeData, changes, dataConsumer, nodeTypeDataManager,
           nodeData.getVersionHistoryIdentifier(), nodeData.getBaseVersionIdentifier());
  
        if (!newVersionHistory)
        {
           for (ItemState state : changes.getAllStates())
           {
              if (!state.getData().getQPath().isDescendantOf(Constants.JCR_SYSTEM_PATH))
              {
                 changesLog.add(state);
              }
           }
        }
        else
        {
           changesLog.addAll(changes.getAllStates());
        }
     }
docs: Create new version history.
  
  @param nodeData
  @throws RepositoryException