diff src/org/tmatesoft/hg/repo/HgIgnore.java @ 114:46291ec605a0

Filters to read and initialize according to configuration files
author Artem Tikhomirov <tikhomirov.artem@gmail.com>
date Thu, 03 Feb 2011 22:13:55 +0100
parents a3a2e5deb320
children 8248aae33f7d
line wrap: on
line diff
--- a/src/org/tmatesoft/hg/repo/HgIgnore.java	Wed Feb 02 21:19:02 2011 +0100
+++ b/src/org/tmatesoft/hg/repo/HgIgnore.java	Thu Feb 03 22:13:55 2011 +0100
@@ -93,6 +93,7 @@
 		sb.append('^'); // help avoid matcher.find() to match 'bin' pattern in the middle of the filename
 		int start = 0, end = line.length() - 1;
 		// '*' at the beginning and end of a line are useless for Pattern
+		// XXX although how about **.txt - such globs can be seen in a config, are they valid for HgIgnore?
 		while (start <= end && line.charAt(start) == '*') start++;
 		while (end > start && line.charAt(end) == '*') end--;
 
@@ -118,6 +119,7 @@
 		return sb.toString();
 	}
 
+	// TODO use Path and PathGlobMatcher
 	public boolean isIgnored(String path) {
 		for (Pattern p : entries) {
 			if (p.matcher(path).find()) {