changeset 76:658fa6b3a371

Fixed a defect when a file added and removed past some revision was reported as R for status against that rev
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Mon, 24 Jan 2011 04:38:09 +0100
parents e62f9638fb27
children c677e1593919
files src/org/tmatesoft/hg/repo/WorkingCopyStatusCollector.java test/org/tmatesoft/hg/test/TestStatus.java
diffstat 2 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);
+				}
 			}
 		}
 	}
--- 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());