diff src/com/tmate/hgkit/fs/RepositoryLookup.java @ 49:26e3eeaa3962

branch and user filtering for log operation
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Sat, 15 Jan 2011 01:15:38 +0100
parents e34f90b9ded1
children
line wrap: on
line diff
--- a/src/com/tmate/hgkit/fs/RepositoryLookup.java	Fri Jan 14 23:22:20 2011 +0100
+++ b/src/com/tmate/hgkit/fs/RepositoryLookup.java	Sat Jan 15 01:15:38 2011 +0100
@@ -8,8 +8,10 @@
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Iterator;
+import java.util.LinkedHashSet;
 import java.util.LinkedList;
 import java.util.List;
+import java.util.Set;
 
 import com.tmate.hgkit.ll.HgRepository;
 import com.tmate.hgkit.ll.LocalHgRepo;
@@ -57,6 +59,8 @@
 		public String repoLocation;
 		public List<String> files;
 		public int limit = -1;
+		public Set<String> users;
+		public Set<String> branches;
 
 		public static Options parse(String[] commandLineArgs) {
 			Options rv = new Options();
@@ -84,6 +88,20 @@
 							rv.limit = Integer.parseInt(it.next());
 							break;
 						}
+						case (int) 'u' : {
+							if (rv.users == null) {
+								rv.users = new LinkedHashSet<String>();
+							}
+							rv.users.add(it.next());
+							break;
+						}
+						case (int) 'b' : {
+							if (rv.branches == null) {
+								rv.branches = new LinkedHashSet<String>();
+							}
+							rv.branches.add(it.next());
+							break;
+						}
 					}
 				} else {
 					// filename