Changeset 834
- Timestamp:
- 09/04/10 07:44:35 (17 months ago)
- Location:
- trunk/src/jlatexeditor
- Files:
-
- 2 modified
-
JLatexEditorJFrame.java (modified) (1 diff)
-
tools/SVN.java (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/jlatexeditor/JLatexEditorJFrame.java
r821 r834 1046 1046 ""); 1047 1047 if (message != null) { 1048 Pair<Boolean, String> result = SVN.getInstance().commit(getMainEditor().getFile().getParentFile(), message); 1048 Pair<Boolean, String> result = null; 1049 try { 1050 result = SVN.getInstance().commit(getMainEditor().getFile().getParentFile(), message); 1051 } catch (Exception exception) { 1052 statusBar.showMessage("SVN update failed", "SVN update failed: " + exception.getMessage()); 1053 return; 1054 } 1049 1055 statusBar.showMessage("SVN commit", "<html>SVN commit:<br><br>" + result.second + "</html>"); 1050 1056 } -
trunk/src/jlatexeditor/tools/SVN.java
r744 r834 3 3 import util.Pair; 4 4 import util.ProcessUtil; 5 import util.StreamUtils; 5 6 6 7 import java.io.BufferedReader; … … 29 30 } catch (Exception e) { 30 31 e.printStackTrace(); 31 throw new Exception("SVN update failed!" );32 throw new Exception("SVN update failed!", e); 32 33 } 33 34 … … 61 62 } 62 63 64 checkProcessResult(svn, "SVN update"); 65 63 66 return results; 64 67 } 65 68 66 public synchronized Pair<Boolean, String> commit(File dir, String message) { 69 /** 70 * Check if the return code of the svn process is OK. 71 * 72 * @param process svn process 73 */ 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 public synchronized Pair<Boolean, String> commit(File dir, String message) throws Exception { 67 86 message = message.replace('"', ' '); 68 87 message = message.replace('\\', ' '); … … 73 92 } catch (Exception e) { 74 93 e.printStackTrace(); 75 return new Pair<Boolean, String>(false, "<font color=red><b>Exception: " + e.getMessage() + "</b></font>"); 94 throw new Exception("SVN update failed!", e); 95 // return new Pair<Boolean, String>(false, "<font color=red><b>Exception: " + e.getMessage() + "</b></font>"); 76 96 } 77 97 … … 98 118 } 99 119 120 checkProcessResult(svn, "SVN update"); 121 100 122 return new Pair<Boolean, String>(success, builder.toString()); 101 123 } … … 106 128 Process svn; 107 129 try { 108 svn = ProcessUtil.exec(new String[]{"svn", "-- show-updates", "status"}, dir);109 } catch (Exception e) { 110 e.printStackTrace(); 111 throw new Exception("SVN status failed!" );130 svn = ProcessUtil.exec(new String[]{"svn", "--non-interactive", "--show-updates", "status"}, dir); 131 } catch (Exception e) { 132 e.printStackTrace(); 133 throw new Exception("SVN status failed!", e); 112 134 } 113 135 … … 152 174 Process svn = null; 153 175 try { 154 svn = ProcessUtil.exec(new String[]{"svn", " resolved", file.getName()}, file.getParentFile());176 svn = ProcessUtil.exec(new String[]{"svn", "--non-interactive", "resolved", file.getName()}, file.getParentFile()); 155 177 svn.waitFor(); 156 178 } catch (Exception e) {
![(please configure the [header_logo] section in trac.ini)](http://jlatexeditor.endrullis.de/chrome/site/logo_xmas.png)