Package org.tmatesoft.hg.core

Examples of org.tmatesoft.hg.core.Nodeid.shortNotation()


  private String print(HgChangeset cset) throws HgException, HgRuntimeException {
    StringBuilder sb = new StringBuilder();
    Formatter f = new Formatter(sb);
    final Nodeid csetNodeid = cset.getNodeid();
    f.format("changeset:   %d:%s\n", cset.getRevisionIndex(), complete ? csetNodeid : csetNodeid.shortNotation());
    if (cset.getRevisionIndex() == tip || repo.getTags().isTagged(csetNodeid)) {
      sb.append("tag:         ");
      for (String t : repo.getTags().tags(csetNodeid)) {
        sb.append(t);
        sb.append(' ');
View Full Code Here


            if (ge.firstParent().isNull() && ge.secondParent().isNull()) {
              prevRevContent = new ByteArrayDataAccess(new byte[0]);
            } else {
              final Nodeid base = ge.firstParent();
              if (!changelog.isKnown(base) /*only first parent, that's Bundle contract*/) {
                throw new IllegalStateException(String.format("Revision %s needs a parent %s, which is missing in the supplied repo %s", ge.node().shortNotation(), base.shortNotation(), hgRepo.toString()));
              }
              ByteArrayChannel bac = new ByteArrayChannel();
              changelog.rawContent(base, bac); // TODO post-1.0 get DataAccess directly, to avoid
              // extra byte[] (inside ByteArrayChannel) duplication just for the sake of subsequent ByteArrayDataChannel wrap.
              prevRevContent = new ByteArrayDataAccess(bac.toArray());
View Full Code Here

          }
          if (manifestNodeids != null) {
            int manifestRevIndex = manifestNodeids.findIndex(manifest);
            // mimic HgManifest#getRevisionIndex() to keep behavior the same
            if (manifestRevIndex == BAD_REVISION) {
              throw new HgInvalidRevisionException(String.format("Can't find index of revision %s", manifest.shortNotation()), manifest, null);
            }
            changelog2manifest[u] = manifestRevIndex;
          } else {
            changelog2manifest[u] = HgManifest.this.getRevisionIndex(manifest);
          }
View Full Code Here

      // hg in, hg4j in, compare
      List<Nodeid> incoming = runAndCompareIncoming(localRepo, hgRemote);
      Assert.assertTrue("Need remote repository of reasonable size to test incoming command for partially filled case", incoming.size() >= 5);
      //
      Nodeid median = incoming.get(incoming.size() / 2);
      System.out.println("About to pull up to revision " + median.shortNotation());
      new ExecHelper(new OutputParser.Stub(), dest).run("hg", "pull", "-r", median.toString(), hgRemote.getLocation());
      //
      // shall re-read repository to pull up new changes
      localRepo = lookup.detect(dest);
      runAndCompareIncoming(localRepo, hgRemote);
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.