Package com.google.devtools.moe.client.writer

Examples of com.google.devtools.moe.client.writer.Writer


    Ui.Task t = AppContext.RUN.ui.pushTask(
        "create_writer",
        String.format("Creating Writer \"%s\"", term));
    try {
      Writer writer = wc.create(term.options);
      AppContext.RUN.ui.popTaskAndPersist(t, writer.getRoot());
      return writer;
    } catch (WritingError e) {
      AppContext.RUN.ui.error(e, "Error creating writer");
      throw e;
    }
View Full Code Here


    } catch (CodebaseCreationError e) {
      AppContext.RUN.ui.error(e, "Error creating codebase");
      return 1;
    }

    Writer destination;
    try {
      destination = toRepoEx.createWriter(context);
    } catch (WritingError e) {
      AppContext.RUN.ui.error(e, "Error writing to repo");
      return 1;
View Full Code Here

      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.
        Expression referenceToCodebase = new RepositoryExpression(migrationConfig.getToRepository())
              .withOption("localroot", toWriter.getRoot().getAbsolutePath());

        Ui.Task oneMigrationTask = AppContext.RUN.ui.pushTask(
            "perform_individual_migration",
            String.format("Performing individual migration '%s'", m.toString()));
        dr = OneMigrationLogic.migrate(m, context, toWriter, referenceToCodebase);
        lastMigratedRevision = m.fromRevisions.get(m.fromRevisions.size() - 1);
        AppContext.RUN.ui.popTask(oneMigrationTask, "");
      }

      // TODO(user): Add properly formatted one-DraftRevison-per-Migration message for svn.
      migrationsMadeBuilder.add(String.format(
          "%s in repository %s", dr.getLocation(), migrationConfig.getToRepository()));
      toWriter.printPushMessage();
      AppContext.RUN.ui.popTaskAndPersist(migrationTask, toWriter.getRoot());
    }

    List<String> migrationsMade = migrationsMadeBuilder.build();
    if (migrationsMade.isEmpty()) {
      AppContext.RUN.ui.info("No migrations made.");
View Full Code Here

    } catch (CodebaseCreationError e) {
      AppContext.RUN.ui.error(e, "Error creating codebase");
      return 1;
    }

    Writer destination;
    try {
      destination = Parser.parseRepositoryExpression(options.destination).createWriter(context);
    } catch (ParseError e) {
      AppContext.RUN.ui.error(e, "Error parsing change destination");
      return 1;
    } catch (WritingError e) {
      AppContext.RUN.ui.error(e, "Error writing change");
      return 1;
    }

    DraftRevision r = ChangeLogic.change(c, destination);
    if (r == null) {
      return 1;
    }

    AppContext.RUN.ui.popTaskAndPersist(changeTask, destination.getRoot());
    return 0;
  }
View Full Code Here

TOP

Related Classes of com.google.devtools.moe.client.writer.Writer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.