Package org.tmatesoft.hg.util

Examples of org.tmatesoft.hg.util.Path$Matcher$Any


      byte[] tmp = new byte[2 + (((ECFieldFp) params.getCurve().getField())
          .getFieldSize() + 7) / 8];
      tmp[0] = 0x02;
      tmp[1] = (byte) EcCore.fieldElemToBytes(r, params, tmp, 2);
      seq.addElement(new ANY(tmp));

      tmp = new byte[2 + (((ECFieldFp) params.getCurve().getField())
          .getFieldSize() + 7) / 8];
      tmp[0] = 0x02;
      tmp[1] = (byte) EcCore.fieldElemToBytes(s, params, tmp, 2);
      seq.addElement(new ANY(tmp));

      seq.encode(baos);
    } catch (Exception ex) {
      throw new SignatureException("Internal ASN.1 encoding error", ex);
    }
View Full Code Here


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

    System.out.printf("\n\tManifestRevision:%d ms, getFileRevision:%d ms\n", (_e1-_s1)/1000000, (_e2-_e1)/1000000);
  }
 
  //  -agentlib:hprof=cpu=times,heap=sites,depth=10
  private void checkFileSneakerPerformance2() throws Exception {
    Path fname = Path.create("dir9/file9"); // close to the manifest end
    hgRepo.getManifest().getFileRevision(0, fname);
//    ManifestRevision mr = new ManifestRevision(null, null);
//    hgRepo.getManifest().walk(2, 2, mr);
  }
View Full Code Here

  public void testAnnotateCmdFollowNoFollow() throws Exception {
    HgRepoFacade hgRepoFacade = new HgRepoFacade();
    HgRepository repo = Configuration.get().find("test-annotate2");
    hgRepoFacade.init(repo);
    HgAnnotateCommand cmd = hgRepoFacade.createAnnotateCommand();
    final Path fname = Path.create("file1b.txt");
    final int changeset = TIP;
    AnnotateInspector ai = new AnnotateInspector();

    cmd.changeset(changeset);
    // follow
View Full Code Here

    return mergeState;
  }
 
  public HgDataFile getFileNode(String path) {
    CharSequence nPath = normalizePath.rewrite(path);
    Path p = sessionContext.getPathFactory().path(nPath);
    return getFileNode(p);
  }
View Full Code Here

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

          iterateControl.stop();
          return;
        }
        if (!da.isEmpty()) {
          // although unlikely, manifest entry may be empty, when all files have been deleted from the repository
          Path fname = null;
          Flags flags = null;
          Nodeid nid = null;
          int i;
          byte[] data = da.byteArray();
          for (i = 0; i < actualLen; i++) {
View Full Code Here

    final HgDirstate ds = getDirstateImpl();
    TreeSet<Path> knownEntries = ds.all(); // here just to get dirstate initialized
    while (repoWalker.hasNext()) {
      cs.checkCancelled();
      repoWalker.next();
      final Path fname = getPathPool().mangle(repoWalker.name());
      FileInfo f = repoWalker.file();
      Path knownInDirstate;
      if (!f.exists()) {
        // file coming from iterator doesn't exist.
        if ((knownInDirstate = ds.known(fname)) != null) {
          // found in dirstate
          processed.add(knownInDirstate);
View Full Code Here

        try {
          // XXX perhaps, shall take second parent into account if not null, too?
          Nodeid nidFromDirstate = getDirstateParentManifest().nodeid(fname);
          if (nidFromDirstate != null) {
            // see if file revision known in this parent got copied from one of baseRevNames
            Path origin = HgStatusCollector.getOriginIfCopy(repo, fname, nidFromDirstate, collect.files(), baseRevision);
            if (origin != null) {
              inspector.copied(getPathPool().mangle(origin), fname);
              return;
            }
          }
View Full Code Here

    // With copy and original timestamps we pretend commit happens to an existing repository
    // in a regular manner (it's unlikely to have commits within the same second in a real life)
    // XXX Note, once we have more robust method to detect file changes (e.g. Java7), this
    // approach shall be abandoned.
    File repoLoc = RepoUtils.copyRepoToTempLocation("log-1", "test-commit-rollback");
    final Path newFilePath = Path.create("xx");
    final File newFile = new File(repoLoc, newFilePath.toString());
    RepoUtils.createFile(newFile, "xyz");
    HgRepository hgRepo = new HgLookup().detect(repoLoc);
    HgDataFile dfB = hgRepo.getFileNode("b");
    HgDataFile dfD = hgRepo.getFileNode("d");
    assertTrue("[sanity]", dfB.exists());
View Full Code Here

TOP

Related Classes of org.tmatesoft.hg.util.Path$Matcher$Any

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.