Subversion Repositories XServices

Rev

Rev 149 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 149 Rev 150
Line 45... Line 45...
45
	
45
	
46
	/** The author. */
46
	/** The author. */
Line 47... Line 47...
47
	private final String author;
47
	private final String author;
48
	
48
	
Line 49... Line 49...
49
	/** The commit message */
49
	/** The commit message */
50
	private final String logmessage;
50
	private String logmessage;
Line 51... Line 51...
51
	
51
	
Line 196... Line 196...
196
	 */
196
	 */
197
	/**
197
	/**
198
	 * Parses the issues.
198
	 * Parses the issues.
199
	 *
199
	 *
200
	 * @param patterns the patterns
200
	 * @param patterns the patterns
-
 
201
	 * @param isRemoveIssues 
201
	 */
202
	 */
202
	public void parseIssues(String[] patterns) {
203
	public void parseIssues(String[] patterns, boolean isRemoveIssues) {
203
		issues.clear(); //reset
204
		issues.clear(); //reset
204
		int count = 0;
205
		int count = 0;
205
		for(String p : patterns) {
206
		for(String p : patterns) {
206
			Pattern regex = Pattern.compile(p);
207
			Pattern regex = Pattern.compile(p);
207
			Matcher matcher = regex.matcher(logmessage);
208
			Matcher matcher = regex.matcher(logmessage);
Line 209... Line 210...
209
			while( matcher.find()) {
210
			while( matcher.find()) {
210
				issues.add( matcher.group() );
211
				issues.add( matcher.group() );
211
				logger.debug("Found  issue '" + matcher.group() + "' in the logmessage.");
212
				logger.debug("Found  issue '" + matcher.group() + "' in the logmessage.");
212
				count++;
213
				count++;
213
			}
214
			}
-
 
215
			if(isRemoveIssues) {
-
 
216
				logmessage = matcher.replaceAll("");
-
 
217
				logger.debug("Removing all matched issues from commit message");
-
 
218
			}
-
 
219
			
214
		}
220
		}
215
		logger.debug("Found '" + count + "' issues in the logmessage.");
221
		logger.debug("Found '" + count + "' issues in the logmessage.");
216
	}
222
	}
Line 217... Line 223...
217
	
223