# HG changeset patch # User Artem Tikhomirov # Date 1295840289 -3600 # Node ID 658fa6b3a3718b8f8c17dba4867a5238bc2b66f5 # Parent e62f9638fb27027215d1b6fbcca74a4e0fe479c2 Fixed a defect when a file added and removed past some revision was reported as R for status against that rev diff -r e62f9638fb27 -r 658fa6b3a371 src/org/tmatesoft/hg/repo/WorkingCopyStatusCollector.java --- a/src/org/tmatesoft/hg/repo/WorkingCopyStatusCollector.java Mon Jan 24 04:18:22 2011 +0100 +++ b/src/org/tmatesoft/hg/repo/WorkingCopyStatusCollector.java Mon Jan 24 04:38:09 2011 +0100 @@ -125,7 +125,10 @@ inspector.missing(m); } else { // removed from the repo - inspector.removed(m); + // if we check against non-tip revision, do not report files that were added past that revision and now removed. + if (collect == null || baseRevFiles.contains(m)) { + inspector.removed(m); + } } } } diff -r e62f9638fb27 -r 658fa6b3a371 test/org/tmatesoft/hg/test/TestStatus.java --- a/test/org/tmatesoft/hg/test/TestStatus.java Mon Jan 24 04:18:22 2011 +0100 +++ b/test/org/tmatesoft/hg/test/TestStatus.java Mon Jan 24 04:38:09 2011 +0100 @@ -32,7 +32,7 @@ /** - * + * * @author Artem Tikhomirov * @author TMate Software Ltd. */ @@ -97,6 +97,14 @@ // TODO check not -A, but defaults()/custom set of modifications } + public void testRemovedAgainstNonTip() { + /* + status --rev N when a file added past revision N was removed ((both physically and in dirstate), but not yet committed + + Reports extra REMOVED file (the one added and removed in between). Shall not + */ + } + private static void report(String what, StatusCollector.Record r, StatusOutputParser statusParser) { System.out.println(">>>" + what); reportNotEqual("MODIFIED", r.getModified(), statusParser.getModified());