Package com.google.devtools.moe.client.repositories

Examples of com.google.devtools.moe.client.repositories.Revision


  public static DraftRevision migrate(Migration migration,
                                      ProjectContext context,
                                      Writer destination,
                                      Expression referenceToCodebase) {

    Revision mostRecentFromRev = migration.fromRevisions.get(migration.fromRevisions.size() - 1);

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


          new InputSource(new StringReader(log)));
      NodeList nl = doc.getElementsByTagName("logentry");
      ImmutableList.Builder<Revision> resultBuilder = ImmutableList.builder();
      for (int i = 0; i < nl.getLength(); i++) {
        String revId = nl.item(i).getAttributes().getNamedItem("revision").getNodeValue();
        resultBuilder.add(new Revision(revId, repositoryName));
      }
      return resultBuilder.build();
    } catch (Exception e) {
      throw new MoeProblem("Could not parse xml log: " + log + e.getMessage());
    }
View Full Code Here

        if (i + 1 >= nl.getLength()) {
          resultBuilder.add(parseMetadataNodeList(revId, nlEntries, ImmutableList.<Revision>of()));
        } else {
          String parentId = nl.item(i + 1).getAttributes().getNamedItem("revision").getNodeValue();
          resultBuilder.add(parseMetadataNodeList(revId, nlEntries,
              ImmutableList.of(new Revision(parentId, name))));
        }
      }
      return resultBuilder.build();
    } catch (Exception e) {
      throw new MoeProblem("Could not parse xml log: " + log + e.getMessage());
View Full Code Here

  @Override
  public Writer create(Map<String, String> options) throws WritingError {
    Utils.checkKeys(options, ImmutableSet.of("revision"));
    String revId = options.get("revision");
    Revision r = revisionHistory.findHighestRevision(options.get("revision"));
    File tempDir = AppContext.RUN.fileSystem.getTemporaryDirectory(
        String.format("svn_writer_%s_", r.revId));
    SvnWriter writer = new SvnWriter(config, r, tempDir);
    writer.checkOut();
    return writer;
View Full Code Here

      } 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) {
View Full Code Here

    if (rh == null) {
      AppContext.RUN.ui.error("Repository " + r.name + " does not support revision history.");
      return 1;
    }

    Revision rev = rh.findHighestRevision(repoEx.getOption("revision"));

    List<Equivalence> lastEquivs = LastEquivalenceLogic.lastEquivalence(
        options.withRepository, rev, db, rh);

    if (lastEquivs.isEmpty()) {
View Full Code Here

    @Override
    public Revision findHighestRevision(String revId) {
      if (Strings.isNullOrEmpty(revId)) {
        revId = "1";
      }
      return new Revision(revId, name);
    }
View Full Code Here

                          revision.revId, revision.repositoryName, name));
      }
      return new RevisionMetadata(revision.revId, "author", "date",
                                  revision.revId.equals("migrated_to") ?
                                  "MOE_MIGRATED_REVID=migrated_from" : "description",
                                  ImmutableList.of(new Revision("parent", name)));
    }
View Full Code Here

    }

    @Override
    public <T> T findRevisions(Revision revision, RevisionMatcher<T> matcher) {
      if (revision == null) {
        revision = new Revision("migrated_to", name);
      }
      RevisionGraph revTree = RevisionGraph.builder(ImmutableList.of(revision))
          .addRevision(revision, getMetadata(revision))
          .build();
      return matcher.makeResult(revTree, ImmutableList.of(new Revision("1", name)));
    }
View Full Code Here

    // Short-circuit Utils.filterFilesByPredicate(ignore_files_re).
    expect(AppContext.RUN.fileSystem.findFiles(new File(archiveTempDir)))
        .andReturn(ImmutableSet.<File>of());

    expect(mockRevHistory.findHighestRevision(null))
        .andReturn(new Revision("mock head changeset ID", MOCK_REPO_NAME));
    expect(mockRepo.archiveAtRevision("mock head changeset ID"))
        .andReturn(new File(archiveTempDir));

    control.replay();
View Full Code Here

TOP

Related Classes of com.google.devtools.moe.client.repositories.Revision

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.