Subversion Repositories XServices

Compare Revisions

Ignore whitespace Rev 151 → Rev 152

/SVN-ALFEventEmitter/trunk/src/net/brutex/svn/SVNLookExecutor.java
22,6 → 22,7
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
 
import net.brutex.svn.SVNCommitInfo.ChangeType;
41,6 → 42,8
private final String repos;
private String TXN = null;
private String rev = null;
private String locale = "de_DE.UTF-8";
private String encoding = "UTF-8";
/**
* Instantiates a new sVN look executor.
86,10 → 89,11
 
ProcessBuilder pf = new ProcessBuilder(cmdline);
logger.debug(String.format("Executing svnlook with commandline '%s'.", pf.command()));
Map<String, String> env = pf.environment();
env.put("LANG", locale);
Process svnprocess = pf.start();
BufferedReader stdin = new BufferedReader(new InputStreamReader(svnprocess.getInputStream()));
BufferedReader stderr = new BufferedReader(new InputStreamReader(svnprocess.getErrorStream()));
BufferedReader stdin = new BufferedReader(new InputStreamReader(svnprocess.getInputStream(), encoding));
BufferedReader stderr = new BufferedReader(new InputStreamReader(svnprocess.getErrorStream(), encoding));
String s;
while( (s = stdin.readLine()) != null ) {
sb.append(s + '\n');
173,5 → 177,18
return result;
}
public void setEncoding(String encoding) {
this.encoding = encoding;
}
/**
* Set the locale that will be pushed into
* 'LANG' environment variable.
*
* @param locale i.e. de_DE.UTF-8
*/
public void setLocale(String locale) {
this.locale = locale;
}
 
}
/SVN-ALFEventEmitter/trunk/src/net/brutex/emitter/ALFEmitter.java
104,6 → 104,8
// Keys to read from the configuration file.
//
private static final String OPTION_SVNLOOK = "svnlook";
private static final String OPTION_LOCALE = "env.LANG";
private static final String OPTION_ENCODING = "env.encoding";
private static final String OPTION_ISSUEPATTERN = "issuepattern";
private static final String OPTION_EVENTTEMPLATE = "eventtemplate";
118,7 → 120,6
private static final String OPTION_SBM_TABLE = "querytable";
private static final String OPTION_SBM_QUERY = "query";
 
private static final String OPTION_MARKER_LOGMESSAGE = "marker.logmessage";
private static final String OPTION_MARKER_AUTHOR = "marker.author";
private static final String OPTION_MARKER_REVISION = "marker.revision";
244,8 → 245,8
logger.debug(String.format("Using property value '%s' for key '%s'. This is the default value. The property is optional.", value, key));
}
}
if(value!=null) logger.debug(String.format("Using property value '%s' for key '%s'.", value, key));
if(logmessage!=null) logger.info(logmessage);
if(logmessage==null) logmessage="";
if(value!=null) logger.debug(String.format("Using property value '%s' for key '%s'. %s", value, key, logmessage));
return value;
}
286,6 → 287,8
//for a pure Java implementation in future
final String svnlook = readConfPropertyAsString(OPTION_SVNLOOK, null, true, null);
EmitterUtil.verifyFile(svnlook, false, true);
final String locale = readConfPropertyAsString(OPTION_LOCALE, "de_DE.UTF-8", true, null);
final String encoding = readConfPropertyAsString(OPTION_LOCALE, "UTF-8", true, "Note that this should match your selected '"+OPTION_LOCALE+"'.");
// Issue Id RegEx to parse commit message
final String[] issuepatterns = readConfPropertyAsStringArray(OPTION_ISSUEPATTERN, false, null);
305,6 → 308,9
SVNLookExecutor exec = new SVNLookExecutor(new File(svnlook), repos);
if(cmd.hasOption(PARAM_TXN)) exec.setTXN(txn);
if(cmd.hasOption(PARAM_REV)) exec.setRev(rev);
exec.setEncoding(encoding);
exec.setLocale(locale);
info = exec.getCommitInfo();
info.parseIssues(issuepatterns, isRemoveIssues);
/SVN-ALFEventEmitter/trunk/src/log4j.properties
2,6 → 2,7
log4j.rootLogger=DEBUG, A1
log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.encoding=UTF-8
 
# Print the date in ISO 8601 format
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c{2} - %m%n