Examples of HgChangesetFileSneaker


Examples of org.tmatesoft.hg.core.HgChangesetFileSneaker

//    m.dumpCompleteManifestHigh();
//    m.bunchOfTests();
  }
 
  private void checkFileSneakerPerformance() throws Exception {
    HgChangesetFileSneaker fs1 = new HgChangesetFileSneaker(hgRepo);
    HgChangesetFileSneaker fs2 = new HgChangesetFileSneaker(hgRepo);
    fs1.followRenames(true);
    fs2.followRenames(true);
    Nodeid cset = hgRepo.getChangelog().getRevision(2);
    Path fname = Path.create("dir9/file9"); // close to the manifest end
    fs1.changeset(cset);
    fs2.changeset(cset);
//    hgRepo.getManifest().getFileRevision(TIP, fname);
    final long start1 = System.nanoTime();
    boolean e1 = fs1.checkExists(fname);
    final long end1 = System.nanoTime();
    boolean e2 = fs2.checkExists(fname);
    final long end2 = System.nanoTime();
    Nodeid fr = hgRepo.getManifest().getFileRevision(TIP, fname);
    final long end3 = System.nanoTime();
    System.out.printf("\t1st run: %d ms, %b\n\t2nd run: %d ms, %b\n\tfile only: %d ms", (end1 - start1) / 1000000, e1, (end2 - end1) / 1000000, e2, (end3-end2)/1000000);
    if (!fr.equals(fs1.revision()) || !fr.equals(fs2.revision())) {
      throw new AssertionError();
    }
    ManifestRevision mr = new ManifestRevision(null, null);
    final long _s1 = System.nanoTime();
    hgRepo.getManifest().walk(0, 0, mr);
View Full Code Here

Examples of org.tmatesoft.hg.core.HgChangesetFileSneaker

    final Nodeid cset = Nodeid.fromAscii("08db726a0fb7914ac9d27ba26dc8bbf6385a0554");
    cmd.changeset(cset);
    final ByteArrayChannel sink = new ByteArrayChannel();
    cmd.execute(sink);
    final int result1 = sink.toArray().length;
    HgChangesetFileSneaker i = new HgChangesetFileSneaker(repo);
    boolean result = i.changeset(cset).checkExists(file);
    assertFalse(result);
    assertFalse(i.exists());
    result = i.followRenames(true).checkExists(file);
    assertTrue(result);
    assertTrue(i.exists());
    HgCatCommand cmd2 = new HgCatCommand(repo).revision(i.getFileRevision());
    final ByteArrayChannel sink2 = new ByteArrayChannel();
    cmd2.execute(sink2);
    final int result2 = sink2.toArray().length;
    assertEquals(result1, result2);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.