Package com.google.devtools.moe.client.database

Examples of com.google.devtools.moe.client.database.EquivalenceMatcher


      ProjectContext context, MigrationConfig migrationConfig, Db db) {

    Repository fromRepo = context.repositories.get(migrationConfig.getFromRepository());
    EquivalenceMatchResult equivMatch = fromRepo.revisionHistory.findRevisions(
        null,  // Start at head.
        new EquivalenceMatcher(migrationConfig.getToRepository(), db));

    // TODO(user): Decide whether to migrate linear or graph history here. Once DVCS Writers
    // support writing a graph of Revisions, we'll need to opt for linear or graph history based
    // on the MigrationConfig (e.g. whether or not the destination repo is linear-only).
    List<Revision> revisionsSinceEquivalence =
View Full Code Here


   * @param rh the RevisionHistory for rev's Repository
   * @return the most recent Equivalence or null if there wasn't one
   */
  public static List<Equivalence> lastEquivalence(String toRepo, Revision rev,
                                            Db db, RevisionHistory rh) {
    EquivalenceMatcher matcher = new EquivalenceMatcher(toRepo, db);
    return rh.findRevisions(rev, matcher).getEquivalences();
  }
View Full Code Here

    }

    control.replay();
    SvnRevisionHistory history = new SvnRevisionHistory("internal_svn",
        "http://foo/svn/trunk/");
    List<Revision> newRevisions = history.findRevisions(null, new EquivalenceMatcher("public", db))
        .getRevisionsSinceEquivalence()
        .getLinearHistory();
    assertEquals(2, newRevisions.size());
    assertEquals("internal_svn", newRevisions.get(0).repositoryName);
    assertEquals("3", newRevisions.get(0).revId);
View Full Code Here

    FileDb database = FileDb.makeDbFromDbText(testDb1);
    SvnRevisionHistory history = new SvnRevisionHistory("repo2", "http://foo/svn/trunk/");

    EquivalenceMatchResult result = history.findRevisions(
        new Revision("4", "repo2"), new EquivalenceMatcher("repo1", database));

    control.verify();

    Equivalence expectedEq = new Equivalence(new Revision("1002", "repo1"),
                                             new Revision("2", "repo2"));
View Full Code Here

    FileDb database = FileDb.makeDbFromDbText(testDb2);
    SvnRevisionHistory history = new SvnRevisionHistory("repo2", "http://foo/svn/trunk/");

    EquivalenceMatchResult result = history.findRevisions(
        new Revision("2", "repo2"), new EquivalenceMatcher("repo1", database));

    control.verify();
   
    assertEquals(0, result.getEquivalences().size());
  }
View Full Code Here

      String fromRepository, String toRepository, Db db, ProjectContext context, boolean inverse) {

    RevisionHistory toHistory = context.repositories.get(toRepository).revisionHistory;
    EquivalenceMatchResult equivMatch = toHistory.findRevisions(
        null /*revision*/,
        new EquivalenceMatcher(fromRepository, db));

    List<Revision> linearToRevs = equivMatch.getRevisionsSinceEquivalence().getLinearHistory();
    AppContext.RUN.ui.info(String.format(
        "Found %d revisions in %s since equivalence (%s): %s",
        linearToRevs.size(),
View Full Code Here

        .andReturn("parent < uid@google.com < date < description < ");

    control.replay();

    HgRevisionHistory rh = new HgRevisionHistory(Suppliers.ofInstance(mockRepo));
    List<Revision> newRevisions = rh.findRevisions(null, new EquivalenceMatcher("public", db))
        .getRevisionsSinceEquivalence()
        .getLinearHistory();
    assertEquals(2, newRevisions.size());
    assertEquals(MOCK_REPO_NAME, newRevisions.get(0).repositoryName);
    assertEquals("mockChangesetID", newRevisions.get(0).revId);
View Full Code Here

    FileDb database = FileDb.makeDbFromDbText(testDb1);

    HgRevisionHistory history = new HgRevisionHistory(Suppliers.ofInstance(mockRepo));

    EquivalenceMatchResult result =
        history.findRevisions(null, new EquivalenceMatcher("repo1", database));

    Equivalence expectedEq = new Equivalence(new Revision("1002", "repo1"),
                                             new Revision("2", "repo2"));
    assertEquals(ImmutableList.of(expectedEq), result.getEquivalences());
View Full Code Here

    FileDb database = FileDb.makeDbFromDbText(testDb2);

    HgRevisionHistory history = new HgRevisionHistory(Suppliers.ofInstance(mockRepo));
    EquivalenceMatchResult result = history.findRevisions(
        new Revision("4", "repo2"), new EquivalenceMatcher("repo1", database));

    assertEquals(0, result.getEquivalences().size());

    control.verify();
  }
View Full Code Here

        .andReturn(METADATA_JOINER.join("parent", "uid@google.com", "date", "", "description"));

    control.replay();

    GitRevisionHistory rh = new GitRevisionHistory(Suppliers.ofInstance(mockRepo));
    List<Revision> newRevisions = rh.findRevisions(null, new EquivalenceMatcher("mockRepo", db))
        .getRevisionsSinceEquivalence()
        .getBreadthFirstHistory();

    assertEquals(3, newRevisions.size());
    assertEquals(repositoryName, newRevisions.get(0).repositoryName);
View Full Code Here

TOP

Related Classes of com.google.devtools.moe.client.database.EquivalenceMatcher

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.