comparison src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.java @ 314:fb74133d2025

Issue 14: NPE for merged dirstate and a file missed in dirstate's first parent
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Tue, 27 Sep 2011 06:34:54 +0200
parents 981f9f50bb6c
children 4c7e3ba67213
comparison
equal deleted inserted replaced
313:c1e3c18fd2f2 314:fb74133d2025
270 } else { 270 } else {
271 // size is the same or unknown, and, perhaps, different timestamp 271 // size is the same or unknown, and, perhaps, different timestamp
272 // check actual content to avoid false modified files 272 // check actual content to avoid false modified files
273 HgDataFile df = repo.getFileNode(fname); 273 HgDataFile df = repo.getFileNode(fname);
274 Nodeid rev = getDirstateParentManifest().nodeid(fname); 274 Nodeid rev = getDirstateParentManifest().nodeid(fname);
275 if (!areTheSame(f, df, rev)) { 275 // rev might be null here if fname comes to dirstate as a result of a merge operation
276 // where one of the parents (first parent) had no fname file, but second parent had.
277 // E.g. fork revision 3, revision 4 gets .hgtags, few modifications and merge(3,12)
278 // see Issue 14 for details
279 if (rev == null || !areTheSame(f, df, rev)) {
276 inspector.modified(df.getPath()); 280 inspector.modified(df.getPath());
277 } else { 281 } else {
278 inspector.clean(df.getPath()); 282 inspector.clean(df.getPath());
279 } 283 }
280 } 284 }