# HG changeset patch # User Artem Tikhomirov # Date 1360091182 -3600 # Node ID 5a455624be4f147c11d3860282f2067690dd12bd # Parent 2813a26b8999039a6e52a44f01004c2aad2c8e5e Update javadoc for HgManifest.Inspector and fix erroneous internal API diff -r 2813a26b8999 -r 5a455624be4f src/org/tmatesoft/hg/internal/ManifestRevision.java --- a/src/org/tmatesoft/hg/internal/ManifestRevision.java Tue Feb 05 16:36:58 2013 +0100 +++ b/src/org/tmatesoft/hg/internal/ManifestRevision.java Tue Feb 05 20:06:22 2013 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2012 TMate Software Ltd + * Copyright (c) 2011-2013 TMate Software Ltd * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,7 +26,7 @@ /** * Specific revision of the manifest. - * Note, suited to keep single revision only ({@link #changeset()}). + * Note, suited to keep single revision only ({@link #revision()}), which is linked to changeset {@link #changesetRevisionIndex()}. * * @author Artem Tikhomirov * @author TMate Software Ltd. @@ -36,8 +36,8 @@ private final TreeMap flagsMap; private final Convertor idsPool; private final Convertor namesPool; - private Nodeid changeset; - private int changelogRev; + private Nodeid manifestRev; + private int changelogRevIndex, manifestRevIndex; // optional pools for effective management of nodeids and filenames (they are likely // to be duplicated among different manifest revisions @@ -62,14 +62,21 @@ } /** - * @return identifier of the changeset this manifest revision corresponds to. + * @return identifier of this manifest revision */ - public Nodeid changeset() { - return changeset; + public Nodeid revision() { + return manifestRev; } - public int changesetLocalRev() { - return changelogRev; + public int revisionIndex() { + return manifestRevIndex; + } + + /** + * @return revision index for the changelog this manifest revision is linked to + */ + public int changesetRevisionIndex() { + return changelogRevIndex; } // @@ -100,13 +107,14 @@ return false; } - public boolean begin(int revision, Nodeid nid, int changelogRevision) { - if (changeset != null) { + public boolean begin(int revisionIndex, Nodeid revision, int changelogRevisionIndex) { + if (manifestRev != null) { idsMap.clear(); flagsMap.clear(); } - changeset = nid; - changelogRev = changelogRevision; + manifestRev = revision; + manifestRevIndex = revisionIndex; + changelogRevIndex = changelogRevisionIndex; return true; } } \ No newline at end of file diff -r 2813a26b8999 -r 5a455624be4f src/org/tmatesoft/hg/repo/HgManifest.java --- a/src/org/tmatesoft/hg/repo/HgManifest.java Tue Feb 05 16:36:58 2013 +0100 +++ b/src/org/tmatesoft/hg/repo/HgManifest.java Tue Feb 05 20:06:22 2013 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2012 TMate Software Ltd + * Copyright (c) 2010-2013 TMate Software Ltd * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -354,15 +354,35 @@ @Callback public interface Inspector { - boolean begin(int mainfestRevision, Nodeid nid, int changelogRevision); /** + * Denotes entering specific manifest revision, separate entries are + * reported with subsequence {@link #next(Nodeid, Path, Flags)} calls. + * + * @param mainfestRevisionIndex local revision index of the inspected revision + * @param manifestRevision revision of the manifest we're about to iterate through + * @param changelogRevisionIndex local revision index of changelog this manifest points to + * @return true to continue iteration, false to stop + */ + boolean begin(int mainfestRevisionIndex, Nodeid manifestRevision, int changelogRevisionIndex); + + + /** + * Reports each manifest entry + * * @param nid file revision * @param fname file name * @param flags one of {@link HgManifest.Flags} constants, not null * @return true to continue iteration, false to stop */ boolean next(Nodeid nid, Path fname, Flags flags); - boolean end(int manifestRevision); + + /** + * Denotes leaving specific manifest revision, after all entries were reported using {@link #next(Nodeid, Path, Flags)} + * + * @param manifestRevisionIndex indicates manifest revision, corresponds to opening {@link #begin(int, Nodeid, int)} + * @return true to continue iteration, false to stop + */ + boolean end(int manifestRevisionIndex); } /** diff -r 2813a26b8999 -r 5a455624be4f src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.java --- a/src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.java Tue Feb 05 16:36:58 2013 +0100 +++ b/src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.java Tue Feb 05 20:06:22 2013 +0100 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011-2012 TMate Software Ltd + * Copyright (c) 2011-2013 TMate Software Ltd * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -198,7 +198,7 @@ // as long as no nodeids can be provided for WC, seems reasonable to report // latest known nodeid change (although at the moment this is not used and // is done mostly not to leave stale initialization in the Record) - int rev1,rev2 = getDirstateParentManifest().changesetLocalRev(); + int rev1,rev2 = getDirstateParentManifest().changesetRevisionIndex(); if (baseRevision == TIP || baseRevision == WORKING_COPY) { rev1 = rev2 - 1; // just use revision prior to dirstate's parent } else {