Mercurial > hg4j
comparison src/org/tmatesoft/hg/internal/ChangelogHelper.java @ 247:f052f40839ec
Issue 9: NPE in getModificationDate for files with status 'Unknown'
author | Artem Tikhomirov <tikhomirov.artem@gmail.com> |
---|---|
date | Fri, 12 Aug 2011 17:17:37 +0200 |
parents | ba2bf656f00f |
children | 5f9073eabf06 |
comparison
equal
deleted
inserted
replaced
246:ff4fdbab4e2d | 247:f052f40839ec |
---|---|
58 * @return changeset where specified file is mentioned among affected files, or | 58 * @return changeset where specified file is mentioned among affected files, or |
59 * <code>null</code> if none found up to leftBoundary | 59 * <code>null</code> if none found up to leftBoundary |
60 */ | 60 */ |
61 public RawChangeset findLatestChangeWith(Path file) { | 61 public RawChangeset findLatestChangeWith(Path file) { |
62 HgDataFile df = repo.getFileNode(file); | 62 HgDataFile df = repo.getFileNode(file); |
63 if (!df.exists()) { | |
64 return null; | |
65 } | |
63 int changelogRev = df.getChangesetLocalRevision(HgRepository.TIP); | 66 int changelogRev = df.getChangesetLocalRevision(HgRepository.TIP); |
64 if (changelogRev >= leftBoundary) { | 67 if (changelogRev >= leftBoundary) { |
65 // the method is likely to be invoked for different files, | 68 // the method is likely to be invoked for different files, |
66 // while changesets might be the same. Cache 'em not to read too much. | 69 // while changesets might be the same. Cache 'em not to read too much. |
67 RawChangeset cs = cache.get(changelogRev); | 70 RawChangeset cs = cache.get(changelogRev); |