Package org.tmatesoft.hg.repo

Examples of org.tmatesoft.hg.repo.HgDataFile.content()


    System.out.println(f1.isCopy());
    System.out.println(f2.isCopy());
    ByteArrayChannel bac = new ByteArrayChannel();
    f1.content(1, bac); // 0: 1151, 1: 1139
    System.out.println(bac.toArray().length);
    f2.content(0, bac = new ByteArrayChannel()); // 0: 14269
    System.out.println(bac.toArray().length);
  }
 
  private void dumpIgnored() throws HgInvalidControlFileException {
    String[] toCheck = new String[] {"design.txt", "src/com/tmate/hgkit/ll/Changelog.java", "src/Extras.java", "bin/com/tmate/hgkit/ll/Changelog.class"};
View Full Code Here


      if (fn.exists()) {
        int total = fn.getRevisionCount();
        System.out.printf("Total revisions: %d\n", total);
        for (int i = 0; i < total; i++) {
          ByteArrayChannel sink = new ByteArrayChannel();
          fn.content(i, sink);
          System.out.println("==========>");
          byte[] content = sink.toArray();
          System.out.println(new String(content));
          int[] parentRevisions = new int[2];
          byte[] parent1 = new byte[20];
View Full Code Here

    errorCollector.assertTrue(status.get(Kind.Added).isEmpty());
    errorCollector.assertTrue(status.get(newFileNode.getPath()).contains(Kind.Clean));
    //
    errorCollector.assertTrue(newFileNode.exists());
    final ByteArrayChannel read1 = new ByteArrayChannel();
    newFileNode.content(0, read1);
    errorCollector.assertEquals("Read from existing HgDataFile instance", newFileContent, read1.toArray());
    final ByteArrayChannel read2 = new ByteArrayChannel();
    hgRepo.getFileNode(newFileNode.getPath()).content(0, read2);
    errorCollector.assertEquals("Read from fresh HgDataFile instance", newFileContent, read2.toArray());
  }
View Full Code Here

    ByteArrayChannel ch = new ByteArrayChannel();
    HgDataFile dir_b = repo.getFileNode("dir/b");
    Assert.assertTrue(dir_b.isCopy());
    Assert.assertEquals("b", dir_b.getCopySourceName().toString());
    Assert.assertEquals("e44751cdc2d14f1eb0146aa64f0895608ad15917", dir_b.getCopySourceRevision().toString());
    dir_b.content(0, ch);
    // assert rawContent has 1 10 ... 1 10
    assertArrayEquals("a \r\n".getBytes(), ch.toArray());
    //
    // try once again to make sure metadata records/extracts correct offsets
    dir_b.content(0, ch = new ByteArrayChannel());
View Full Code Here

    dir_b.content(0, ch);
    // assert rawContent has 1 10 ... 1 10
    assertArrayEquals("a \r\n".getBytes(), ch.toArray());
    //
    // try once again to make sure metadata records/extracts correct offsets
    dir_b.content(0, ch = new ByteArrayChannel());
    assertArrayEquals("a \r\n".getBytes(), ch.toArray());
  }

  @Test
  public void testWorkingCopyFileAccess() throws Exception {
View Full Code Here

        return cached.second();
      }
      HgDataFile df = getFile(clogRevIndex);
      try {
        ByteArrayChannel c;
        df.content(fileRevIndex, c = new ByteArrayChannel());
        LineSequence rv = LineSequence.newlines(c.toArray());
        lruCache.addFirst(new Pair<Integer, LineSequence>(clogRevIndex, rv));
        if (lruCache.size() > limit) {
          lruCache.removeLast();
        }
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.