# HG changeset patch # User Artem Tikhomirov # Date 1321322848 -3600 # Node ID f377f833b78098c313f8611fa35ed2b832d47767 # Parent f74e36b7344be2cbe78a9ab3f15a3c58ddeeed19 Issue 17: temporary code to nail down the problem diff -r f74e36b7344b -r f377f833b780 src/org/tmatesoft/hg/repo/HgRepository.java --- a/src/org/tmatesoft/hg/repo/HgRepository.java Fri Nov 11 05:56:09 2011 +0100 +++ b/src/org/tmatesoft/hg/repo/HgRepository.java Tue Nov 15 03:07:28 2011 +0100 @@ -303,6 +303,11 @@ /*package-local*/ File getRepositoryRoot() { return repoDir; } + + // FIXME remove once NPE in HgWorkingCopyStatusCollector.areTheSame is solved + /*package-local, debug*/String getStoragePath(HgDataFile df) { + return dataPathHelper.rewrite(df.getPath().toString()).toString(); + } // XXX package-local, unless there are cases when required from outside (guess, working dir/revision walkers may hide dirstate access and no public visibility needed) // XXX consider passing Path pool or factory to produce (shared) Path instead of Strings diff -r f74e36b7344b -r f377f833b780 src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.java --- a/src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.java Fri Nov 11 05:56:09 2011 +0100 +++ b/src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.java Tue Nov 15 03:07:28 2011 +0100 @@ -30,6 +30,7 @@ import java.util.Set; import java.util.TreeSet; +import org.tmatesoft.hg.core.HgBadStateException; import org.tmatesoft.hg.core.HgDataStreamException; import org.tmatesoft.hg.core.HgException; import org.tmatesoft.hg.core.Nodeid; @@ -271,6 +272,10 @@ // size is the same or unknown, and, perhaps, different timestamp // check actual content to avoid false modified files HgDataFile df = repo.getFileNode(fname); + if (!df.exists()) { + String msg = String.format("File %s known as normal in dirstate (%d, %d), doesn't exist at %s", fname, r.modificationTime(), r.size(), repo.getStoragePath(df)); + throw new HgBadStateException(msg); + } Nodeid rev = getDirstateParentManifest().nodeid(fname); // rev might be null here if fname comes to dirstate as a result of a merge operation // where one of the parents (first parent) had no fname file, but second parent had.