Examples of HgTags


Examples of org.tmatesoft.hg.repo.HgTags

    HgRepository hgRepo = cmdLineOpts.findRepository();
    if (hgRepo.isInvalid()) {
      System.err.printf("Can't find repository in: %s\n", hgRepo.getLocation());
      return;
    }
    HgTags tags = hgRepo.getTags();
    final HgChangelog clog = hgRepo.getChangelog();
    final Map<TagInfo, Integer> ti2index = new HashMap<TagInfo, Integer>();
    final TreeSet<TagInfo> sorted = new TreeSet<HgTags.TagInfo>(new Comparator<TagInfo>() {

      public int compare(TagInfo o1, TagInfo o2) {
        // reverse, from newer to older (bigger indexes first);
        // never ==, tags from same revision in any order, just next to each other
        int x1 = ti2index.get(o1);
        int x2 = ti2index.get(o2);
        return x1 < x2 ? 1 : -1;
      }
    });
    for (TagInfo ti : tags.getAllTags().values()) {
      int x = clog.getRevisionIndex(ti.revision()); // XXX in fact, performance hog. Need batch revisionIndex or another improvement
      ti2index.put(ti, x);
      sorted.add(ti);
    }
    for (TagInfo ti : sorted) {
View Full Code Here

Examples of org.tmatesoft.hg.repo.HgTags

  }

  public void collectTagsPerFile() throws HgException, CancelledException, HgRuntimeException {
    final long start = System.currentTimeMillis();
    final HgRepository repository = new HgLookup().detect(new File("/home/artem/hg/cpython"));
    final HgTags tags = repository.getTags();
    //
    // build cache
    //
    final TagInfo[] allTags = new TagInfo[tags.getAllTags().size()];
    tags.getAllTags().values().toArray(allTags);
    // effective translation of changeset revisions to their local indexes
    final HgRevisionMap<HgChangelog> clogrmap = new HgRevisionMap<HgChangelog>(repository.getChangelog()).init();
    // map to look up tag by changeset local number
    final IntMap<List<TagInfo>> tagLocalRev2TagInfo = new IntMap<List<TagInfo>>(allTags.length);
    System.out.printf("Collecting manifests for %d tags\n", allTags.length);
View Full Code Here

Examples of org.tmatesoft.hg.repo.HgTags

  }
 
  public static void main2(String[] args) throws HgCallbackTargetException, HgException, CancelledException, HgRuntimeException {
    final HgRepository repository = new HgLookup().detect(new File("/temp/hg/cpython"));
    final Path targetPath = Path.create("README");
    final HgTags tags = repository.getTags();
    final Map<String, HgTags.TagInfo> tagToInfo = tags.getAllTags();
    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);
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.