# HG changeset patch # User Artem Tikhomirov # Date 1298582179 -3600 # Node ID ba2bf656f00fd5d60ae2fdad6e46115524bbdab8 # Parent ab7ea2ac21cbec118cba8d88d774d55f0784e19c Changeset => RawChangeset diff -r ab7ea2ac21cb -r ba2bf656f00f src/org/tmatesoft/hg/core/HgChangeset.java --- a/src/org/tmatesoft/hg/core/HgChangeset.java Thu Feb 24 21:38:46 2011 +0100 +++ b/src/org/tmatesoft/hg/core/HgChangeset.java Thu Feb 24 22:16:19 2011 +0100 @@ -21,7 +21,7 @@ import java.util.List; import org.tmatesoft.hg.core.HgLogCommand.FileRevision; -import org.tmatesoft.hg.repo.HgChangelog.Changeset; +import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; import org.tmatesoft.hg.repo.HgRepository; import org.tmatesoft.hg.repo.HgStatusCollector; import org.tmatesoft.hg.util.Path; @@ -40,7 +40,7 @@ private final Path.Source pathHelper; // - private Changeset changeset; + private RawChangeset changeset; private Nodeid nodeid; // @@ -56,7 +56,7 @@ } /*package-local*/ - void init(int localRevNumber, Nodeid nid, Changeset rawChangeset) { + void init(int localRevNumber, Nodeid nid, RawChangeset rawChangeset) { revNumber = localRevNumber; nodeid = nid; changeset = rawChangeset; diff -r ab7ea2ac21cb -r ba2bf656f00f src/org/tmatesoft/hg/core/HgLogCommand.java --- a/src/org/tmatesoft/hg/core/HgLogCommand.java Thu Feb 24 21:38:46 2011 +0100 +++ b/src/org/tmatesoft/hg/core/HgLogCommand.java Thu Feb 24 22:16:19 2011 +0100 @@ -26,7 +26,7 @@ import java.util.Set; import java.util.TreeSet; -import org.tmatesoft.hg.repo.HgChangelog.Changeset; +import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; import org.tmatesoft.hg.repo.HgChangelog; import org.tmatesoft.hg.repo.HgDataFile; import org.tmatesoft.hg.repo.HgRepository; @@ -162,7 +162,7 @@ } /** - * Similar to {@link #execute(org.tmatesoft.hg.repo.Changeset.Inspector)}, collects and return result as a list. + * Similar to {@link #execute(org.tmatesoft.hg.repo.RawChangeset.Inspector)}, collects and return result as a list. */ public List execute() { CollectHandler collector = new CollectHandler(); @@ -224,7 +224,7 @@ // - public void next(int revisionNumber, Nodeid nodeid, Changeset cset) { + public void next(int revisionNumber, Nodeid nodeid, RawChangeset cset) { if (limit > 0 && count >= limit) { return; } diff -r ab7ea2ac21cb -r ba2bf656f00f src/org/tmatesoft/hg/core/HgStatus.java --- a/src/org/tmatesoft/hg/core/HgStatus.java Thu Feb 24 21:38:46 2011 +0100 +++ b/src/org/tmatesoft/hg/core/HgStatus.java Thu Feb 24 22:16:19 2011 +0100 @@ -19,7 +19,7 @@ import java.util.Date; import org.tmatesoft.hg.internal.ChangelogHelper; -import org.tmatesoft.hg.repo.HgChangelog.Changeset; +import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; import org.tmatesoft.hg.util.Path; /** @@ -71,7 +71,7 @@ * @return null if author for the change can't be deduced (e.g. for clean files it's senseless) */ public String getModificationAuthor() { - Changeset cset = logHelper.findLatestChangeWith(path); + 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? @@ -84,7 +84,7 @@ } public Date getModificationDate() { - Changeset cset = logHelper.findLatestChangeWith(path); + RawChangeset cset = logHelper.findLatestChangeWith(path); if (cset == null) { // FIXME check dirstate and/or local file for tstamp return new Date(); // what's correct diff -r ab7ea2ac21cb -r ba2bf656f00f src/org/tmatesoft/hg/internal/ChangelogHelper.java --- a/src/org/tmatesoft/hg/internal/ChangelogHelper.java Thu Feb 24 21:38:46 2011 +0100 +++ b/src/org/tmatesoft/hg/internal/ChangelogHelper.java Thu Feb 24 22:16:19 2011 +0100 @@ -18,7 +18,7 @@ import java.util.TreeMap; -import org.tmatesoft.hg.repo.HgChangelog.Changeset; +import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; import org.tmatesoft.hg.repo.HgDataFile; import org.tmatesoft.hg.repo.HgInternals; import org.tmatesoft.hg.repo.HgRepository; @@ -32,7 +32,7 @@ public class ChangelogHelper { private final int leftBoundary; private final HgRepository repo; - private final TreeMap cache = new TreeMap(); + private final TreeMap cache = new TreeMap(); private String nextCommitAuthor; /** @@ -58,13 +58,13 @@ * @return changeset where specified file is mentioned among affected files, or * null if none found up to leftBoundary */ - public Changeset findLatestChangeWith(Path file) { + public RawChangeset findLatestChangeWith(Path file) { HgDataFile df = repo.getFileNode(file); int changelogRev = df.getChangesetLocalRevision(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. - Changeset cs = cache.get(changelogRev); + RawChangeset cs = cache.get(changelogRev); if (cs == null) { cs = repo.getChangelog().range(changelogRev, changelogRev).get(0); cache.put(changelogRev, cs); diff -r ab7ea2ac21cb -r ba2bf656f00f src/org/tmatesoft/hg/internal/KeywordFilter.java --- a/src/org/tmatesoft/hg/internal/KeywordFilter.java Thu Feb 24 21:38:46 2011 +0100 +++ b/src/org/tmatesoft/hg/internal/KeywordFilter.java Thu Feb 24 22:16:19 2011 +0100 @@ -21,7 +21,7 @@ import java.util.Map; import java.util.TreeMap; -import org.tmatesoft.hg.repo.HgChangelog.Changeset; +import org.tmatesoft.hg.repo.HgChangelog.RawChangeset; import org.tmatesoft.hg.repo.HgRepository; import org.tmatesoft.hg.util.Path; @@ -37,7 +37,7 @@ private final TreeMap keywords; private final int minBufferLen; private final Path path; - private Changeset latestFileCset; + private RawChangeset latestFileCset; /** * @@ -266,7 +266,7 @@ return String.format("%tY/% range(int start, int end) { - final ArrayList rv = new ArrayList(end - start + 1); + public List range(int start, int end) { + final ArrayList rv = new ArrayList(end - start + 1); RevlogStream.Inspector i = new RevlogStream.Inspector() { public void next(int revisionNumber, int actualLen, int baseRevision, int linkRevision, int parent1Revision, int parent2Revision, byte[] nodeid, byte[] data) { - Changeset cset = Changeset.parse(data, 0, data.length); + RawChangeset cset = RawChangeset.parse(data, 0, data.length); rv.add(cset); } }; @@ -81,7 +81,7 @@ public void next(int revisionNumber, int actualLen, int baseRevision, int linkRevision, int parent1Revision, int parent2Revision, byte[] nodeid, byte[] data) { if (Arrays.binarySearch(revisions, revisionNumber) >= 0) { - Changeset cset = Changeset.parse(data, 0, data.length); + RawChangeset cset = RawChangeset.parse(data, 0, data.length); inspector.next(revisionNumber, Nodeid.fromBinary(nodeid, 0), cset); } } @@ -92,13 +92,13 @@ public interface Inspector { // TODO describe whether cset is new instance each time - void next(int revisionNumber, Nodeid nodeid, Changeset cset); + void next(int revisionNumber, Nodeid nodeid, RawChangeset cset); } /** * Entry in the Changelog */ - public static class Changeset implements Cloneable /* for those that would like to keep a copy */{ + public static class RawChangeset implements Cloneable /* for those that would like to keep a copy */{ // TODO immutable private/* final */Nodeid manifest; private String user; @@ -124,7 +124,7 @@ * changelog v0 doesn't use extra * */ - private Changeset() { + private RawChangeset() { } public Nodeid manifest() { @@ -190,16 +190,16 @@ } @Override - public Changeset clone() { + public RawChangeset clone() { try { - return (Changeset) super.clone(); + return (RawChangeset) super.clone(); } catch (CloneNotSupportedException ex) { throw new InternalError(ex.toString()); } } - public static Changeset parse(byte[] data, int offset, int length) { - Changeset rv = new Changeset(); + public static RawChangeset parse(byte[] data, int offset, int length) { + RawChangeset rv = new RawChangeset(); rv.init(data, offset, length); return rv; }