Package org.tmatesoft.hg.core

Examples of org.tmatesoft.hg.core.Nodeid


       
        for (int taggedRevision : tagLocalRevs) {
          // current file revision can't appear in tags that point to earlier changelog revisions (they got own file revision)
          if (taggedRevision >= changesetRevisionIndex) {
            // z points to some changeset with tag
            Nodeid wasKnownAs = fileRevisionAtTagRevision.get(taggedRevision);
            if (wasKnownAs.equals(fileRevision)) {
              // has tag associated with changeset at index z
              List<TagInfo> tagsAtRev = tagRevIndex2TagInfo.get(taggedRevision);
              assert tagsAtRev != null;
              for (TagInfo ti : tagsAtRev) {
                associatedTags.add(ti.name());
              }
            }
          }
        }
        //
        System.out.printf("%3d%7d%s\n", fileRevisionIndex, changesetRevisionIndex, associatedTags);
      }
    });
    for (int i = 0, lastRev = fileNode.getLastRevision(); i <= lastRev; i++) {
      Nodeid fileRevision = fileNode.getRevision(i);
      List<String> associatedTags2 = fileRev2TagNames.get(fileRevision);
      int changesetRevIndex = fileNode.getChangesetRevisionIndex(i);
      System.out.printf("%3d%7d%s\n", i, changesetRevIndex, associatedTags2 == null ? Collections.emptyList() : associatedTags2);
    }
    System.out.printf("Alternative total time: %d ms, of that init: %d ms\n", (System.nanoTime() - start2)/1000000, (start2a-start2)/1000000);
View Full Code Here


    final HgManifest manifest = repository.getManifest();
    final Map<Nodeid, List<String>> changeSetRevisionToTags = new HashMap<Nodeid, List<String>>();
    final HgDataFile fileNode = repository.getFileNode(targetPath);
    for (String tagName : tagToInfo.keySet()) {
      final HgTags.TagInfo info = tagToInfo.get(tagName);
      final Nodeid nodeId = info.revision();
      // TODO: This is not correct as we can't be sure that file at the corresponding revision is actually our target file (which may have been renamed, etc.)
      final Nodeid fileRevision = manifest.getFileRevision(repository.getChangelog().getRevisionIndex(nodeId), targetPath);
      if (fileRevision == null) {
        continue;
      }

      final Nodeid changeSetRevision = fileNode.getChangesetRevision(fileRevision);
      List<String> revisionTags = changeSetRevisionToTags.get(changeSetRevision);
      if (revisionTags == null) {
        revisionTags = new ArrayList<String>();
        changeSetRevisionToTags.put(changeSetRevision, revisionTags);
      }
View Full Code Here

TOP

Related Classes of org.tmatesoft.hg.core.Nodeid

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.