if (migrations.isEmpty()) {
AppContext.RUN.ui.info("No pending revisions to migrate for " + migrationName);
continue;
}
Equivalence lastEq = migrations.get(0).sinceEquivalence;
// toRe represents toRepo at the revision of last equivalence with fromRepo.
RepositoryExpression toRe = new RepositoryExpression(migrationConfig.getToRepository());
if (lastEq != null) {
toRe = toRe.atRevision(
lastEq.getRevisionForRepository(migrationConfig.getToRepository()).revId);
}
Writer toWriter;
try {
toWriter = toRe.createWriter(context);
} catch (WritingError e) {
throw new MoeProblem("Couldn't create local repo " + toRe + ": " + e);
}
DraftRevision dr = null;
Revision lastMigratedRevision = null;
if (lastEq != null) {
lastMigratedRevision = lastEq.getRevisionForRepository(migrationConfig.getFromRepository());
}
for (Migration m : migrations) {
// For each migration, the reference to-codebase for inverse translation is the Writer,
// since it contains the latest changes (i.e. previous migrations) to the to-repository.