changeset 473:5c09a9f2e073

Issue 34: incorrect status for a file copy in wc against base rev
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 11 Jul 2012 22:45:29 +0200
parents 2a0b09eec376
children 09f2d38ecf26
files src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.java test/org/tmatesoft/hg/test/TestAuxUtilities.java test/org/tmatesoft/hg/test/TestStatus.java
diffstat 3 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.java	Wed Jul 11 21:46:28 2012 +0200
+++ b/src/org/tmatesoft/hg/repo/HgWorkingCopyStatusCollector.java	Wed Jul 11 22:45:29 2012 +0200
@@ -270,9 +270,12 @@
 			}
 		}
 		if (collect != null) {
+			// perhaps, this code shall go after processing leftovers of knownEntries, below
+			// as it's sort of last resort - what to do with otherwise unprocessed base revision files
 			for (Path fromBase : baseRevFiles) {
 				if (repoWalker.inScope(fromBase)) {
 					inspector.removed(fromBase);
+					processed.add(fromBase);
 					cs.checkCancelled();
 				}
 			}
@@ -404,7 +407,8 @@
 				}
 			} else if ((r = ds.checkAdded(fname)) != null) {
 				if (r.copySource() != null && baseRevNames.contains(r.copySource())) {
-					baseRevNames.remove(r.copySource()); // FIXME likely I shall report rename source as Removed, same as above for Normal?
+					// shall not remove rename source from baseRevNames, as the source
+					// likely needs to be reported as Removed as well
 					inspector.copied(r.copySource(), fname);
 					return;
 				}
--- a/test/org/tmatesoft/hg/test/TestAuxUtilities.java	Wed Jul 11 21:46:28 2012 +0200
+++ b/test/org/tmatesoft/hg/test/TestAuxUtilities.java	Wed Jul 11 22:45:29 2012 +0200
@@ -318,7 +318,7 @@
 		}
 		*/
 		for (int i = 0; i < roots.length; i++) {
-			System.out.printf("%s & %s = 0x%x\n", toBinaryString(descendantBitset[i]), toBinaryString(~(1<<roots[i])), descendantBitset[i] & ~(1<<roots[i]));
+//			System.out.printf("%s & %s = 0x%x\n", toBinaryString(descendantBitset[i]), toBinaryString(~(1<<roots[i])), descendantBitset[i] & ~(1<<roots[i]));
 			if ((descendantBitset[i] & ~(1<<roots[i])) != 0) {
 				assertTrue(result[i].hasDescendants());
 			} else {
--- a/test/org/tmatesoft/hg/test/TestStatus.java	Wed Jul 11 21:46:28 2012 +0200
+++ b/test/org/tmatesoft/hg/test/TestStatus.java	Wed Jul 11 22:45:29 2012 +0200
@@ -739,6 +739,9 @@
 			Collections.sort(sl1);
 			ArrayList<T> sl2 = new ArrayList<T>(l2);
 			Collections.sort(sl2);
+			if (!sl1.isEmpty() && !sl2.isEmpty()) {
+				what = what + ", diff:" + difference(sl1, sl2);
+			}
 			errorCollector.checkThat(what, sl1, equalTo(sl2));
 		}