Subversion Repositories XServices

Rev

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

Rev 150 Rev 152
Line 102... Line 102...
102
	
102
	
103
	//
103
	//
104
	// Keys to read from the configuration file.
104
	// Keys to read from the configuration file.
105
	//
105
	//
-
 
106
	private static final String OPTION_SVNLOOK = "svnlook";
-
 
107
	private static final String OPTION_LOCALE = "env.LANG";
106
	private static final String OPTION_SVNLOOK = "svnlook";
108
	private static final String OPTION_ENCODING = "env.encoding";
Line 107... Line 109...
107
	private static final String OPTION_ISSUEPATTERN = "issuepattern";
109
	private static final String OPTION_ISSUEPATTERN = "issuepattern";
108
	
110
	
109
	private static final String OPTION_EVENTTEMPLATE = "eventtemplate";
111
	private static final String OPTION_EVENTTEMPLATE = "eventtemplate";
Line 116... Line 118...
116
	private static final String OPTION_SBM_USER = "sbmuser";
118
	private static final String OPTION_SBM_USER = "sbmuser";
117
	private static final String OPTION_SBM_PASSWORD = "sbmpassword";
119
	private static final String OPTION_SBM_PASSWORD = "sbmpassword";
118
	private static final String OPTION_SBM_TABLE = "querytable";
120
	private static final String OPTION_SBM_TABLE = "querytable";
119
	private static final String OPTION_SBM_QUERY = "query";
121
	private static final String OPTION_SBM_QUERY = "query";
Line 120... Line -...
120
 
-
 
121
	
122
 
122
	private static final String OPTION_MARKER_LOGMESSAGE = "marker.logmessage";
123
	private static final String OPTION_MARKER_LOGMESSAGE = "marker.logmessage";
123
	private static final String OPTION_MARKER_AUTHOR = "marker.author";
124
	private static final String OPTION_MARKER_AUTHOR = "marker.author";
124
	private static final String OPTION_MARKER_REVISION = "marker.revision";
125
	private static final String OPTION_MARKER_REVISION = "marker.revision";
125
	private static final String OPTION_MARKER_ADDEDFILES = "marker.addedfiles";
126
	private static final String OPTION_MARKER_ADDEDFILES = "marker.addedfiles";
Line 242... Line 243...
242
			if(value == null && defaultValue!=null) {
243
			if(value == null && defaultValue!=null) {
243
				//No value, but default
244
				//No value, but default
244
				logger.debug(String.format("Using property value '%s' for key '%s'. This is the default value. The property is optional.", value, key));
245
				logger.debug(String.format("Using property value '%s' for key '%s'. This is the default value. The property is optional.", value, key));
245
			}
246
			}
246
		}
247
		}
-
 
248
		if(logmessage==null) logmessage="";
247
		if(value!=null) logger.debug(String.format("Using property value '%s' for key '%s'.", value, key));
249
		if(value!=null) logger.debug(String.format("Using property value '%s' for key '%s'. %s", value, key, logmessage));
248
		if(logmessage!=null) logger.info(logmessage);
-
 
249
		return value;
250
		return value;
250
	}
251
	}
Line 251... Line 252...
251
	
252
	
Line 284... Line 285...
284
		 */
285
		 */
285
		//it might be interesting to look into SVNKit
286
		//it might be interesting to look into SVNKit
286
		//for a pure Java implementation in future
287
		//for a pure Java implementation in future
287
			final String svnlook			=	readConfPropertyAsString(OPTION_SVNLOOK, null, true, null);
288
			final String svnlook			=	readConfPropertyAsString(OPTION_SVNLOOK, null, true, null);
288
			EmitterUtil.verifyFile(svnlook, false, true);
289
			EmitterUtil.verifyFile(svnlook, false, true);
-
 
290
			final String locale				=	readConfPropertyAsString(OPTION_LOCALE, "de_DE.UTF-8", true, null);
-
 
291
			final String encoding			=	readConfPropertyAsString(OPTION_LOCALE, "UTF-8", true, "Note that this should match your selected '"+OPTION_LOCALE+"'.");
Line 289... Line 292...
289
			
292
			
290
			// Issue Id RegEx to parse commit message
293
			// Issue Id RegEx to parse commit message
291
			final String[] issuepatterns = readConfPropertyAsStringArray(OPTION_ISSUEPATTERN, false, null);
294
			final String[] issuepatterns = readConfPropertyAsStringArray(OPTION_ISSUEPATTERN, false, null);
292
			StringBuilder sb = new StringBuilder(); for(String s : issuepatterns) sb.append(s);
295
			StringBuilder sb = new StringBuilder(); for(String s : issuepatterns) sb.append(s);
Line 303... Line 306...
303
			 * Use svnlook to obtain information from SVN
306
			 * Use svnlook to obtain information from SVN
304
			 */
307
			 */
305
			SVNLookExecutor exec = new SVNLookExecutor(new File(svnlook), repos);
308
			SVNLookExecutor exec = new SVNLookExecutor(new File(svnlook), repos);
306
			if(cmd.hasOption(PARAM_TXN)) exec.setTXN(txn);
309
			if(cmd.hasOption(PARAM_TXN)) exec.setTXN(txn);
307
			if(cmd.hasOption(PARAM_REV)) exec.setRev(rev);
310
			if(cmd.hasOption(PARAM_REV)) exec.setRev(rev);
-
 
311
			exec.setEncoding(encoding);
-
 
312
			exec.setLocale(locale);
-
 
313
			
308
			info = exec.getCommitInfo();			
314
			info = exec.getCommitInfo();			
309
			info.parseIssues(issuepatterns, isRemoveIssues);
315
			info.parseIssues(issuepatterns, isRemoveIssues);
Line 310... Line 316...
310
			
316
			
311
			logger.debug("SVNCommitInfo author: "+ info.getAuthor());
317
			logger.debug("SVNCommitInfo author: "+ info.getAuthor());