PackageVersionContentSource newPvcs = new PackageVersionContentSource(pv, contentSource, newDetails
.getLocation());
newPvcs = entityManager.merge(newPvcs);
// for all repos that are associated with this content source, add this package version directly to them
RepoPackageVersion mapping = new RepoPackageVersion(repo, pv);
entityManager.merge(mapping); // use merge just in case this mapping somehow already exists
// Cleanup
if ((++flushCount % 100) == 0) {
knownResourceTypes.clear();