Package org.tmatesoft.hg.core

Examples of org.tmatesoft.hg.core.HgCatCommand.file()


 
  @Test
  public void testCatAtCsetRevision() throws Exception {
    HgCatCommand cmd = new HgCatCommand(repo);
    final Path file = Path.create("src/org/tmatesoft/hg/internal/RevlogStream.java");
    cmd.file(file);
    final Nodeid cset = Nodeid.fromAscii("08db726a0fb7914ac9d27ba26dc8bbf6385a0554");
    cmd.changeset(cset);
    final ByteArrayChannel sink = new ByteArrayChannel();
    cmd.execute(sink);
    final int result1 = sink.toArray().length;
View Full Code Here


  public void testRenamedFileInCset() throws Exception {
    repo = Configuration.get().find("log-renames");
    HgCatCommand cmd1 = new HgCatCommand(repo);
    HgCatCommand cmd2 = new HgCatCommand(repo);
    cmd1.file(Path.create("a")); // a is initial b through temporary c
    cmd2.file(Path.create("c"));
    ByteArrayChannel sink1, sink2;
    // a from wc/tip was c in rev 4
    cmd1.changeset(4).execute(sink1 = new ByteArrayChannel());
    cmd2.changeset(4).execute(sink2 = new ByteArrayChannel());
    assertArrayEquals(sink2.toArray(), sink1.toArray());
View Full Code Here

    cmd1.changeset(4).execute(sink1 = new ByteArrayChannel());
    cmd2.changeset(4).execute(sink2 = new ByteArrayChannel());
    assertArrayEquals(sink2.toArray(), sink1.toArray());
    //
    // d from wc/tip was a in 0..2 and b in rev 3..4. Besides, there's another d in r4
    cmd2.file(Path.create("d"));
    cmd1.changeset(2).execute(sink1 = new ByteArrayChannel());
    cmd2.changeset(2).execute(sink2 = new ByteArrayChannel());
    assertArrayEquals(sink1.toArray(), sink2.toArray());
    //
    cmd1.file(Path.create("b"));
View Full Code Here

 
  @Test
  public void testCatCommandCancelSupport() throws Exception {
    HgRepository repository = Configuration.get().find("branches-1"); // any repo
    final HgCatCommand cmd = new HgCatCommand(repository);
    cmd.file(Path.create("file1"));
    cmd.set(new CancelSupport() {
      int i = 0;
      public void checkCancelled() throws CancelledException {
        if (i++ == 2) {
          throw new CancelledException();
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.