Subversion Repositories XServices

Rev

Rev 150 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 150 Rev 152
Line 20... Line 20...
20
import java.io.IOException;
20
import java.io.IOException;
21
import java.io.InputStreamReader;
21
import java.io.InputStreamReader;
22
import java.util.ArrayList;
22
import java.util.ArrayList;
23
import java.util.Date;
23
import java.util.Date;
24
import java.util.List;
24
import java.util.List;
-
 
25
import java.util.Map;
25
import java.util.StringTokenizer;
26
import java.util.StringTokenizer;
Line 26... Line 27...
26
 
27
 
Line 27... Line 28...
27
import net.brutex.svn.SVNCommitInfo.ChangeType;
28
import net.brutex.svn.SVNCommitInfo.ChangeType;
Line 39... Line 40...
39
	private Logger logger = Logger.getLogger(SVNLookExecutor.class);
40
	private Logger logger = Logger.getLogger(SVNLookExecutor.class);
40
	private final File svnlook;
41
	private final File svnlook;
41
	private final String repos;
42
	private final String repos;
42
	private String TXN = null;
43
	private String TXN = null;
43
	private String rev = null;
44
	private String rev = null;
-
 
45
	private String locale = "de_DE.UTF-8";
-
 
46
	private String encoding = "UTF-8";
Line 44... Line 47...
44
	
47
	
45
	/**
48
	/**
46
	 * Instantiates a new sVN look executor.
49
	 * Instantiates a new sVN look executor.
47
	 *
50
	 *
Line 84... Line 87...
84
			cmdline.add(params[1]);
87
			cmdline.add(params[1]);
85
			cmdline.add(repos);
88
			cmdline.add(repos);
Line 86... Line 89...
86
 
89
 
87
			ProcessBuilder pf = new ProcessBuilder(cmdline);
90
			ProcessBuilder pf = new ProcessBuilder(cmdline);
88
			logger.debug(String.format("Executing svnlook with commandline '%s'.", pf.command()));
-
 
-
 
91
			logger.debug(String.format("Executing svnlook with commandline '%s'.", pf.command()));
-
 
92
			Map<String, String> env = pf.environment();
89
			
93
			env.put("LANG", locale);
90
			Process svnprocess = pf.start();
94
			Process svnprocess = pf.start();
91
			BufferedReader stdin = new BufferedReader(new InputStreamReader(svnprocess.getInputStream()));
95
			BufferedReader stdin = new BufferedReader(new InputStreamReader(svnprocess.getInputStream(), encoding));
92
			BufferedReader stderr = new BufferedReader(new InputStreamReader(svnprocess.getErrorStream()));
96
			BufferedReader stderr = new BufferedReader(new InputStreamReader(svnprocess.getErrorStream(), encoding));
93
			String s;
97
			String s;
94
			 while( (s = stdin.readLine()) != null ) {
98
			 while( (s = stdin.readLine()) != null ) {
95
				 sb.append(s + '\n');
99
				 sb.append(s + '\n');
96
			 }
100
			 }
Line 172... Line 176...
172
		result.setRev(rev);
176
		result.setRev(rev);
Line 173... Line 177...
173
		
177
		
174
		return result;
178
		return result;
Line -... Line 179...
-
 
179
	}
-
 
180
	
-
 
181
	public void setEncoding(String encoding) {
-
 
182
		this.encoding = encoding;
-
 
183
	}
-
 
184
	 /**
-
 
185
	  * Set the locale that will be pushed into
-
 
186
	  * 'LANG' environment variable.
-
 
187
	  * 
-
 
188
	  * @param locale i.e. de_DE.UTF-8
-
 
189
	  */
-
 
190
	public void setLocale(String locale) {
-
 
191
		this.locale = locale;
175
	}
192
	}