Package com.google.devtools.moe.client.parser

Examples of com.google.devtools.moe.client.parser.RepositoryExpression


    return new File(filename);
  }

  private RepositoryExpression e(String creatorIdentifier,
                               ImmutableMap<String, String> creatorOptions) {
    return new RepositoryExpression(
        new Term(creatorIdentifier, creatorOptions));
  }
View Full Code Here


    Utils.filterFiles(archiveLocation, nonIgnoredFilePred);

    return new Codebase(
        archiveLocation,
        projectSpace,
        new RepositoryExpression(new Term(headClone.getRepositoryName(), options)));
  }
View Full Code Here

  public void testCheckProjectSpace() throws Exception {
    Codebase c = new Codebase(
            new File("/foo"),
            "internal",
            new RepositoryExpression(new Term("foo", ImmutableMap.<String, String>of())));
    c.checkProjectSpace("internal");
    try {
      c = new Codebase(
              new File("/foo"),
              "internal",
              new RepositoryExpression(new Term("foo", ImmutableMap.<String, String>of())));
      c.checkProjectSpace("public");
      fail();
    } catch (MoeProblem p) {}
  }
View Full Code Here

*/
public class PatchCodebaseDifferenceRendererTest extends TestCase {
 
  private static Codebase makeCodebase(String name) throws Exception {
    return new Codebase(new File("/" + name), "public",
                        new RepositoryExpression(name));
  }
View Full Code Here

    InverseRenamingEditor inverseRenamey = new InverseRenamingEditor(
        new RenamingEditor(
            "renamey", ImmutableMap.of("internal_root", "public_root"), false /*useRegex*/));

    Codebase input = new Codebase(new File("/input"), "public", new RepositoryExpression("input"));
    Codebase destination =
        new Codebase(new File("/destination"), "public", new RepositoryExpression("destination"));

    expect(mockFs.getTemporaryDirectory("inverse_rename_run_")).andReturn(new File("/output"));

    expect(mockFs.findFiles(new File("/input"))).andReturn(ImmutableSet.of(
        new File("/input/toplevel.txt"),
View Full Code Here

   */
  private static void updateHeadEquivalence(String fromRepository, String toRepository,
                                            Db db, ProjectContext context) {
    Codebase to, from;
    try {
      to = new RepositoryExpression(toRepository).createCodebase(context);
      from = new RepositoryExpression(fromRepository)
          .translateTo(to.getProjectSpace())
          .createCodebase(context);
    } catch (CodebaseCreationError e) {
      AppContext.RUN.ui.error(e, "Could not generate codebase");
      return;
View Full Code Here

    }

    Codebase to, from;
    try {
      Expression toEx =
          new RepositoryExpression(toRev.repositoryName).atRevision(toRev.revId);
      Expression fromEx =
          new RepositoryExpression(fromRev.repositoryName).atRevision(fromRev.revId);

      // Use the forward-translator to check an inverse-translated migration.
      if (inverse) {
        String fromProjectSpace =
            context.config.getRepositoryConfigs().get(fromRev.repositoryName).getProjectSpace();
View Full Code Here

    final Predicate<CharSequence> nonIgnoredFilePred =
        Utils.nonMatchingPredicateFromRes(config.getIgnoreFileRes());
    Utils.filterFiles(exportPath, nonIgnoredFilePred);

    return new Codebase(
        exportPath, config.getProjectSpace(), new RepositoryExpression(new Term(name, options)));
  }
View Full Code Here

    Codebase fromCodebase;
    try {
      String toProjectSpace = context.config.getRepositoryConfigs()
          .get(migration.config.getToRepository()).getProjectSpace();

      fromCodebase = new RepositoryExpression(migration.config.getFromRepository())
          .atRevision(mostRecentFromRev.revId)
          .translateTo(toProjectSpace)
          .withReferenceToCodebase(referenceToCodebase)
          .createCodebase(context);
View Full Code Here

  @Override
  public int perform() {
    ProjectContext context;
    String toProjectSpace;
    RepositoryExpression toRepoEx, fromRepoEx;
    Repository toRepo;
    try {
      context = AppContext.RUN.contextFactory.makeProjectContext(options.configFilename);
      toRepoEx = Parser.parseRepositoryExpression(options.toRepository);
      fromRepoEx = Parser.parseRepositoryExpression(options.fromRepository);
      toRepo = context.repositories.get(toRepoEx.getRepositoryName());
      if (toRepo == null) {
        AppContext.RUN.ui.error("No repository " + toRepoEx.getRepositoryName());
        return 1;
      }
      toProjectSpace = context.config.getRepositoryConfigs().get(toRepoEx.getRepositoryName())
          .getProjectSpace();
    } catch (ParseError e) {
      AppContext.RUN.ui.error(e, "Couldn't parse expression");
      return 1;
    } catch (InvalidProject e) {
      AppContext.RUN.ui.error(e, "Couldn't create project");
      return 1;
    }

    List<Revision> revs = Revision.fromRepositoryExpression(fromRepoEx, context);

    Codebase c;
    try {
      c = new RepositoryExpression(fromRepoEx.getRepositoryName())
          .atRevision(revs.get(0).revId)
          .translateTo(toProjectSpace)
          .createCodebase(context);
    } 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

TOP

Related Classes of com.google.devtools.moe.client.parser.RepositoryExpression

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.