Changeset 835 for trunk/src/jlatexeditor/tools/SVN.java
- Timestamp:
- 09/04/10 09:06:26 (21 months ago)
- Files:
-
- 1 modified
-
trunk/src/jlatexeditor/tools/SVN.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/jlatexeditor/tools/SVN.java
r834 r835 26 26 27 27 Process svn; 28 try { 29 svn = ProcessUtil.exec(new String[]{"svn", "--non-interactive", "update"}, dir); 30 } catch (Exception e) { 31 e.printStackTrace(); 32 throw new Exception("SVN update failed!", e); 33 } 28 svn = ProcessUtil.exec(new String[]{"svn", "--non-interactive", "update"}, dir); 34 29 35 30 BufferedReader in = new BufferedReader(new InputStreamReader(svn.getInputStream()), 100000); … … 67 62 } 68 63 69 /**70 * Check if the return code of the svn process is OK.71 *72 * @param process svn process73 */74 private void checkProcessResult(Process process, String action) throws Exception {75 76 try {77 String errorString = new String(StreamUtils.readBytesFromInputStream(process.getErrorStream()));78 throw new Exception(action + " failed due to the following error:\n" + errorString);79 } catch (IOException e) {80 e.printStackTrace();81 throw new Exception(action + " failed!", e);82 }83 }84 85 64 public synchronized Pair<Boolean, String> commit(File dir, String message) throws Exception { 86 65 message = message.replace('"', ' '); 87 66 message = message.replace('\\', ' '); 88 67 89 Process svn; 90 try { 91 svn = ProcessUtil.exec(new String[]{"svn", "--non-interactive", "commit", "-m", message}, dir); 92 } catch (Exception e) { 93 e.printStackTrace(); 94 throw new Exception("SVN update failed!", e); 95 // return new Pair<Boolean, String>(false, "<font color=red><b>Exception: " + e.getMessage() + "</b></font>"); 96 } 97 98 boolean success = true; 68 Process svn = ProcessUtil.exec(new String[]{"svn", "--non-interactive", "commit", "-m", message}, dir); 69 70 boolean success = true; 99 71 100 72 StringBuilder builder = new StringBuilder(); … … 181 153 } 182 154 155 /** 156 * Check if the return code of the svn process is OK. 157 * 158 * @param process svn process 159 */ 160 private void checkProcessResult(Process process, String action) throws Exception { 161 String errorString = new String(StreamUtils.readBytesFromInputStream(process.getErrorStream())); 162 if (!errorString.equals("")) { 163 throw new Exception(action + " failed due to the following error:\n" + errorString); 164 } 165 } 166 183 167 public static class UpdateResult { 184 168 public static final int TYPE_UPDATE = 0;
![(please configure the [header_logo] section in trac.ini)](http://jlatexeditor.endrullis.de/chrome/site/logo.png)