diff src/org/tmatesoft/hg/repo/HgStatusCollector.java @ 316:ee6b467c1a5f

Supply HGFileRevision with copy information when possible, calculate it otherwise
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Wed, 28 Sep 2011 13:09:16 +0200
parents 2ffcbf360fd5
children 678e326fd27c
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgStatusCollector.java	Wed Sep 28 12:18:21 2011 +0200
+++ b/src/org/tmatesoft/hg/repo/HgStatusCollector.java	Wed Sep 28 13:09:16 2011 +0200
@@ -311,6 +311,15 @@
 
 	// XXX for r1..r2 status, only modified, added, removed (and perhaps, clean) make sense
 	// XXX Need to specify whether copy targets are in added or not (@see Inspector#copied above)
+	/**
+	 * Straightforward {@link HgStatusInspector} implementation that collects all status values.
+	 * 
+	 * <p>Naturally, {@link Record Records} originating from {@link HgStatusCollector} would report only <em>modified, added,
+	 * removed</em> and <em>clean</em> values, other are available only when using {@link Record} with {@link HgWorkingCopyStatusCollector}.
+	 * 
+	 * <p>Note, this implementation records copied files as added, thus key values in {@link #getCopied()} map are subset of paths
+	 * from {@link #getAdded()}.  
+	 */
 	public static class Record implements HgStatusInspector {
 		private List<Path> modified, added, removed, clean, missing, unknown, ignored;
 		private Map<Path, Path> copied;
@@ -362,6 +371,9 @@
 			return proper(removed);
 		}
 
+		/**
+		 * Map files from {@link #getAdded()} to their original filenames, if were copied/moved.
+		 */
 		public Map<Path,Path> getCopied() {
 			if (copied == null) {
 				return Collections.emptyMap();
@@ -385,7 +397,7 @@
 			return proper(ignored);
 		}
 		
-		private List<Path> proper(List<Path> l) {
+		private static List<Path> proper(List<Path> l) {
 			if (l == null) {
 				return Collections.emptyList();
 			}