Package org.tmatesoft.hg.core

Examples of org.tmatesoft.hg.core.Nodeid


            }
            currRange = rangeItr.next();
            currRangeList = new LinkedList<Nodeid>();
            rv.put(currRange, currRangeList);
          }
          Nodeid nid = Nodeid.fromAscii(st.sval);
          currRangeList.addLast(nid);
        }
      }
      is.close();
      return rv;
View Full Code Here


    for (Pair<String, String> l : values) {
      if (l.second().length() != Nodeid.SIZE_ASCII) {
        sessionContext.getLog().dump(getClass(), Severity.Warn, "%s: bad nodeid '%s', ignored", actionName, l.second());
        continue;
      }
      Nodeid n = Nodeid.fromAscii(l.second());
      String bm = new String(l.first());
      rv.add(new Pair<String, Nodeid>(bm, n));
    }
    return new Bookmarks(rv);
  }
View Full Code Here

    for (Pair<String, String> l : values) {
      if ("publishing".equalsIgnoreCase(l.first())) {
        publishing = Boolean.parseBoolean(l.second());
        continue;
      }
      Nodeid root = Nodeid.fromAscii(l.first());
      int ph = Integer.parseInt(l.second());
      if (ph == HgPhase.Draft.mercurialOrdinal()) {
        draftRoots.add(root);
      } else {
        assert false;
View Full Code Here

    for (Path r2fname : r2.files()) {
      if (!scope.accept(r2fname)) {
        continue;
      }
      if (r1Files.remove(r2fname)) {
        Nodeid nidR1 = r1.nodeid(r2fname);
        Nodeid nidR2 = r2.nodeid(r2fname);
        HgManifest.Flags flagsR1 = r1.flags(r2fname);
        HgManifest.Flags flagsR2 = r2.flags(r2fname);
        if (nidR1.equals(nidR2) && flagsR2 == flagsR1) {
          inspector.clean(r2fname);
        } else {
View Full Code Here

   */
  public RevisionSet roots(HgParentChildMap<HgChangelog> ph) {
    HashSet<Nodeid> copy = new HashSet<Nodeid>(elements);
    for (Nodeid n : elements) {
      assert ph.knownNode(n);
      Nodeid p1 = ph.firstParent(n);
      if (p1 != null && elements.contains(p1)) {
        copy.remove(n);
        continue;
      }
      Nodeid p2 = ph.secondParent(n);
      if (p2 != null && elements.contains(p2)) {
        copy.remove(n);
        continue;
      }
    }
View Full Code Here

    byte[] parent1 = new byte[Nodeid.SIZE], parent2 = new byte[Nodeid.SIZE];
    int[] parentRevs = new int[2];
    for (Nodeid n : elements) {
      assert clog.isKnown(n);
      clog.parents(clog.getRevisionIndex(n), parentRevs, parent1, parent2);
      if (parentRevs[0] != NO_REVISION && elements.contains(new Nodeid(parent1, false))) {
        copy.remove(n);
        continue;
      }
      if (parentRevs[1] != NO_REVISION && elements.contains(new Nodeid(parent2, false))) {
        copy.remove(n);
        continue;
      }
    }
    return copy.size() == elements.size() ? this : new RevisionSet(copy);
View Full Code Here

  public RevisionSet heads(HgParentChildMap<HgChangelog> ph) {
    HashSet<Nodeid> copy = new HashSet<Nodeid>(elements);
    // can't do copy.removeAll(ph.childrenOf(asList())); as actual heads are indeed children of some other node
    for (Nodeid n : elements) {
      assert ph.knownNode(n);
      Nodeid p1 = ph.firstParent(n);
      Nodeid p2 = ph.secondParent(n);
      if (p1 != null && elements.contains(p1)) {
        copy.remove(p1);
      }
      if (p2 != null && elements.contains(p2)) {
        copy.remove(p2);
View Full Code Here

    HashSet<Nodeid> ancestors = new HashSet<Nodeid>();
    Set<Nodeid> childrenToCheck = chRoots.elements;
    while (!childrenToCheck.isEmpty()) {
      HashSet<Nodeid> nextRound = new HashSet<Nodeid>();
      for (Nodeid n : childrenToCheck) {
        Nodeid p1 = parentHelper.firstParent(n);
        Nodeid p2 = parentHelper.secondParent(n);
        if (p1 != null && elements.contains(p1)) {
          nextRound.add(p1);
        }
        if (p2 != null && elements.contains(p2)) {
          nextRound.add(p2);
View Full Code Here

        // head is immediate child
        resultCommon.add(rb.root);
      } else {
        // between gives result from head to root, I'd like to go in reverse direction
        Collections.reverse(remoteRevisions);
        Nodeid root = rb.root;
        while(!remoteRevisions.isEmpty()) {
          Nodeid n = remoteRevisions.remove(0);
          if (localRepo.knownNode(n)) {
            if (remoteRevisions.isEmpty()) {
              // this is the last known node before an unknown
              resultCommon.add(n);
              break;
            }
            if (remoteRevisions.size() == 1) {
              // there's only one left between known n and unknown head
              // this check is to save extra between query, not really essential
              Nodeid last = remoteRevisions.remove(0);
              resultCommon.add(localRepo.knownNode(last) ? last : n);
              break;
            }
            // might get handy for next between query, to narrow search down
            root = n;
View Full Code Here

          }
        }
      }
    }
    for (RemoteBranch rb : checkUp2Head) {
      Nodeid h = rb.head;
      Nodeid r = rb.root;
      int watchdog = 1000;
      assert head2chain.containsKey(h);
      BranchChain bc = head2chain.get(h);
      assert bc != null : h.toString();
      // if we know branch root locally, there could be no parent branch chain elements.
      assert bc.p1 == null;
      assert bc.p2 == null;
      do {
        List<Nodeid> between = remoteRepo.between(h, r);
        if (between.isEmpty()) {
          bc.branchRoot = r;
          break;
        } else {
          Collections.reverse(between);
          for (Nodeid n : between) {
            if (localRepo.knownNode(n)) {
              r = n;
            } else {
              h = n;
              break;
            }
          }
          Nodeid lastInBetween = between.get(between.size() - 1);
          if (r.equals(lastInBetween)) {
            bc.branchRoot = r;
            break;
          } else if (h.equals(lastInBetween)) { // the only chance for current head pointer to point to the sequence tail
            // is when r is second from the between list end (iow, head,1,[2],4,8...,root)
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.