# HG changeset patch # User Artem Tikhomirov # Date 1305774127 -7200 # Node ID 373e07cd39914c3cdbe0d9a57c61472bed3ecfda # Parent 04735ce6bed20bb122576a4df424bb12ed01a66b Due to discrepancy in manifest and changelor indexes, wrong manifest revisions got cached and compared diff -r 04735ce6bed2 -r 373e07cd3991 cmdline/org/tmatesoft/hg/console/Main.java --- a/cmdline/org/tmatesoft/hg/console/Main.java Thu May 19 04:45:52 2011 +0200 +++ b/cmdline/org/tmatesoft/hg/console/Main.java Thu May 19 05:02:07 2011 +0200 @@ -143,8 +143,8 @@ } public static final class ManifestDump implements HgManifest.Inspector { - public boolean begin(int revision, Nodeid nid) { - System.out.printf("%d : %s\n", revision, nid); + public boolean begin(int manifestRevision, Nodeid nid, int changelogRevision) { + System.out.printf("%d : %s\n", manifestRevision, nid); return true; } diff -r 04735ce6bed2 -r 373e07cd3991 src/org/tmatesoft/hg/core/HgManifestCommand.java --- a/src/org/tmatesoft/hg/core/HgManifestCommand.java Thu May 19 04:45:52 2011 +0200 +++ b/src/org/tmatesoft/hg/core/HgManifestCommand.java Thu May 19 05:02:07 2011 +0200 @@ -147,7 +147,7 @@ pathPool = null; } - public boolean begin(int revision, Nodeid nid) { + public boolean begin(int manifestRevision, Nodeid nid, int changelogRevision) { if (needDirs && manifestContent == null) { manifestContent = new LinkedList(); } diff -r 04735ce6bed2 -r 373e07cd3991 src/org/tmatesoft/hg/repo/HgManifest.java --- a/src/org/tmatesoft/hg/repo/HgManifest.java Thu May 19 04:45:52 2011 +0200 +++ b/src/org/tmatesoft/hg/repo/HgManifest.java Thu May 19 05:02:07 2011 +0200 @@ -69,9 +69,9 @@ } public interface Inspector { - boolean begin(int revision, Nodeid nid); + boolean begin(int mainfestRevision, Nodeid nid, int changelogRevision); boolean next(Nodeid nid, String fname, String flags); - boolean end(int revision); + boolean end(int manifestRevision); } private static class ManifestParser implements RevlogStream.Inspector { @@ -94,7 +94,7 @@ return; } try { - gtg = gtg && inspector.begin(revisionNumber, new Nodeid(nodeid, true)); + gtg = gtg && inspector.begin(revisionNumber, new Nodeid(nodeid, true), linkRevision); int i; String fname = null; String flags = null; diff -r 04735ce6bed2 -r 373e07cd3991 src/org/tmatesoft/hg/repo/HgStatusCollector.java --- a/src/org/tmatesoft/hg/repo/HgStatusCollector.java Thu May 19 04:45:52 2011 +0200 +++ b/src/org/tmatesoft/hg/repo/HgStatusCollector.java Thu May 19 05:02:07 2011 +0200 @@ -65,7 +65,7 @@ cacheFilenames = new Pool(); emptyFakeState = new ManifestRevisionInspector(null, null); - emptyFakeState.begin(-1, null); + emptyFakeState.begin(-1, null, -1); emptyFakeState.end(-1); } @@ -103,15 +103,15 @@ private ManifestRevisionInspector delegate; private boolean cacheHit; // range may include revisions we already know about, do not re-create them - public boolean begin(int revision, Nodeid nid) { + public boolean begin(int manifestRevision, Nodeid nid, int changelogRevision) { assert delegate == null; - if (cache.containsKey(revision)) { // don't need to check emptyFakeState hit as revision never -1 here + if (cache.containsKey(changelogRevision)) { // don't need to check emptyFakeState hit as revision never -1 here cacheHit = true; } else { - cache.put(revision, delegate = new ManifestRevisionInspector(cacheNodes, cacheFilenames)); + cache.put(changelogRevision, delegate = new ManifestRevisionInspector(cacheNodes, cacheFilenames)); // cache may grow bigger than max size here, but it's ok as present simplistic cache clearing mechanism may // otherwise remove entries we just added - delegate.begin(revision, nid); + delegate.begin(manifestRevision, nid, changelogRevision); cacheHit = false; } return true; @@ -458,7 +458,7 @@ return false; } - public boolean begin(int revision, Nodeid nid) { + public boolean begin(int revision, Nodeid nid, int changelogRevision) { return true; } }