Package org.tmatesoft.hg.repo.HgChangelog

Examples of org.tmatesoft.hg.repo.HgChangelog.RawChangeset


      System.out.println(l.isCommitted() ? l.getRevision() : "not yet committed");
      if (l.getType() == Kind.Hg) {
        HgRepository r = l.getRepo();
        System.out.printf("%s (%s) has %d revisions\n", l.getLocation(), r.getLocation(), r.getChangelog().getLastRevision() + 1);
        if (r.getChangelog().getLastRevision() >= 0) {
          final RawChangeset c = r.getChangelog().range(TIP, TIP).get(0);
          System.out.printf("TIP: %s %s '%s'\n", c.user(), c.dateString(), c.comment());
        }
      }
    }
  }
View Full Code Here


          byte[] csetContent = ge.patch().apply(prevRevContent, -1);
          dh = dh.sha1(ge.firstParent(), ge.secondParent(), csetContent); // XXX ge may give me access to byte[] content of nodeid directly, perhaps, I don't need DH to be friend of Nodeid?
          if (!ge.node().equalsTo(dh.asBinary())) {
            throw new HgInvalidStateException(String.format("Integrity check failed on %s, node: %s", bundleFile, ge.node().shortNotation()));
          }
          RawChangeset cs = csetBuilder.parse(csetContent);
          inspector.next(revisionIndex++, ge.node(), cs);
          prevRevContent.done();
          prevRevContent = new ByteArrayDataAccess(csetContent);
        } catch (CancelledException ex) {
          return false;
View Full Code Here

      }
    } else {
      breakIndex4--;
    }
    String _comment = encHelper.commentFromChangeset(data, breakIndex4 + 2, bufferEndIndex - breakIndex4 - 2);
    RawChangeset target = factory.create(_nodeid, _user, _time, _timezone, _files, _comment, _extrasMap);
    return target;
  }
View Full Code Here

    }
    int changelogRev = df.getChangesetRevisionIndex(HgRepository.TIP);
    if (changelogRev >= leftBoundary) {
      // the method is likely to be invoked for different files,
      // while changesets might be the same. Cache 'em not to read too much.
      RawChangeset cs = cache.get(changelogRev);
      if (cs == null) {
        cs = repo.getChangelog().range(changelogRev, changelogRev).get(0);
        cache.put(changelogRev, cs);
      }
      return cs;
View Full Code Here

  /**
   * @return <code>null</code> if author for the change can't be deduced (e.g. for clean files it's senseless)
   * @throws HgRuntimeException subclass thereof to indicate issues with the library. <em>Runtime exception</em>
   */
  public String getModificationAuthor() throws HgRuntimeException {
    RawChangeset cset = logHelper.findLatestChangeWith(path);
    if (cset == null) {
      if (kind == Kind.Modified || kind == Kind.Added || kind == Kind.Removed /*&& RightBoundary is TIP*/) {
        // perhaps, also for Kind.Missing?
        return logHelper.getNextCommitUsername();
      }
    } else {
      return cset.user();
    }
    return null;
  }
View Full Code Here

   * @return date when the file was last modified, never <code>null</code>. Either date of changeset the file was modified at
   * or timestamp of local file, if present
   * @throws HgRuntimeException subclass thereof to indicate issues with the library. <em>Runtime exception</em>
   */
  public Date getModificationDate() throws HgRuntimeException {
    RawChangeset cset = logHelper.findLatestChangeWith(path);
    if (cset == null) {
      File localFile = new File(logHelper.getRepo().getWorkingDir(), path.toString());
      if (localFile.canRead()) {
        return new Date(localFile.lastModified());
      }
      // TODO post-1.1 find out what to do in this case, perhaps, throw an exception?
      // perhaps check dirstate and for timestamp
      return new Date(); // what's correct?
    } else {
      return cset.date();
    }
  }
View Full Code Here

TOP

Related Classes of org.tmatesoft.hg.repo.HgChangelog.RawChangeset

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.